Your workflow is unique 👨💻 - tell us how you use Dropbox here.
Forum Discussion
Braden S.
10 years agoNew member | Level 1
Using new api v2 can't seem to add folder members to a shared folder.
I have been testing out the new HTTP api (here https://www.dropbox.com/developers/documentation/http#documentation ) which looks really promising!
I've successfully shared a folder, but when i add a member to it using https://www.dropbox.com/developers/documentation/http#documentation-sharing-add_folder_member
using a curl command like
curl -X POST https://api.dropboxapi.com/2/sharing/add_folder_member \
--header "Authorization: Bearer <OMITTED>" \
--header "Content-Type: application/json" \
--data '{"shared_folder_id": "<OMITTED REAL FOLDER ID>","members": [{ "member": { "email": "myemail@me.com"}}],"quiet": "false","custom_message": "Yay share a folder"}'
and the error message i keep getting back is
Error in call to API function "sharing/add_folder_member": request body: members.member: missing '.tag' key%
Looking for someone to shed some light on what the actual error is.
Thanks!
2 Replies
Replies have been turned off for this discussion
- Greg-DB10 years ago
Dropbox Community Moderator
You'll need a ".tag" to indicate which option in the MemberSelector union you're using. E.g.,:
curl -X POST https://api.dropboxapi.com/2/sharing/add_folder_member \
--header "Authorization: Bearer <redacted>" \
--header "Content-Type: application/json" \
--data "{\"shared_folder_id\": \"dbsfid:<redacted>\",\"members\":[{\"member\":{\".tag\":\"email\",\"email\":\"email@example.com\"}}],\"quiet\": false,\"custom_message\":\"Documentation for launch day\"}"We'll make a note to improve the documentation with an example for this.
- Braden S.10 years agoNew member | Level 1
Oh, I see. I thought that an open union meant that I could just provide one of the following key/value pairs and it would use that.
Thanks!
About 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!