Forum Discussion

thanasis k.'s avatar
thanasis k.
New member | Level 1
11 years ago

create a folder that will be shared and add a member to it

iam using the code below in a java desktop application, in order to create a folder in a dropbox account that i want to be shared, and i am trying to add another member by his email address, but iam getting:

java.lang.NoSuchMethodError: com.dropbox.core.json.JsonWriter.writeFields(Ljava/lang/Object;Lcom/fasterxml/jackson/core/JsonGenerator;)V
at com.dropbox.core.v2.DbxFiles$CreateFolderArg$1.write(DbxFiles.java:5337)
at com.dropbox.core.v2.DbxFiles$CreateFolderArg$1.write(DbxFiles.java:5332)
at com.dropbox.core.json.JsonWriter.writeToStream(JsonWriter.java:23)
at com.dropbox.core.json.JsonWriter.writeToStream(JsonWriter.java:33)
at com.dropbox.core.v2.DbxRawClientV2.rpcStyle(DbxRawClientV2.java:82)
at com.dropbox.core.v2.DbxFiles.createFolder(DbxFiles.java:8459)
at com.dropbox.core.v2.DbxFiles.createFolder(DbxFiles.java:8479) 

 

my code is the following:

DbxRequestConfig dbxRequestConfig = new DbxRequestConfig("test/1.0", Locale.getDefault().toString());
DbxClientV2 dbxClient = new DbxClientV2(dbxRequestConfig, my_access_token);

FolderMetadata md = dbxClient.files.createFolder("/test");

ArrayList<AddMember> list = new ArrayList();
DbxSharing.AddMember a1 = new DbxSharing.AddMember(DbxSharing.MemberSelector.email("xxxxxx@gmail.com"),DbxSharing.AccessLevel.editor);

list.add(a1);
dbxClient.sharing.addFolderMember(md.parentSharedFolderId, list);

 

i have already search for any solution to create a shared folder and add a member to it, but iam not finding anything useful to my case.

Could anyone tell me what iam doing wrong??please help me ASAP.

14 Replies

Replies have been turned off for this discussion
  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    10 years ago

    Suryakant, you can use the addFolderMember method to add members to already shared folders.

  • Suryakant D.'s avatar
    Suryakant D.
    New member | Level 1
    10 years ago

    @Gregory. Thanks for your reply. Actually I have shared the folder. Added a member to it. Now I want to get and accept the invitation request programtically

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    10 years ago

    You can use the mountFolder method to mount the shared folder in the invited user's account, as long as that user has authorized the app on their account as well.

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.

The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.

If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X, Facebook or Instagram.

For more info on available support options for your Dropbox plan, see this article.

If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!