I generated new full token and shared secret keys via Storage Service UI and when I'm trying download, upload files or call some other methods using api, I'm getting 1015 error code (The request could not be finished due to insufficient access privileges.)
Please, could you explain me the reason.
Thanks a lot.
What utility are you using to upload with? Are you using the namespace? By default, objects created are given the ACL (creator)=FULL_CONTROL and nothing else. This also applies to any directories created implicitly or otherwise. So, if another token created the object and/or directories, you won't have access to them unless you change the ACL.
If you wish to share data between tokens, you should either add public access to the object's ACL and/or the other UIDs. For example, when you create an object, you can set the public read ACL like this:
ObjectPath path = new ObjectPath("/path/to/file.txt");
Acl acl = new Acl();
acl.addGrant( new Grant( new Grantee( uid, Grantee.GRANT_TYPE.USER ), Permission.FULL_CONTROL ) );
acl.addGrant( new Grant( Grantee.OTHER, Permission.READ ) );
ObjectId id = this.esu.createObjectOnPath(path, acl, null, null, "text/plain" );
Note that "uid" above is the last part of your token. If your token is abcd123.../test2, "uid" should only be "test2". In the above example, you will also need to either manually create the directories /path/ and /path/to/ or update their ACL after creating /path/to/file.txt.