Need to see if your shared folder is taking up space on your dropbox 👨‍💻? Find out how to check here.

Forum Discussion

1575475's avatar
1575475
Explorer | Level 3
4 years ago
Solved

Error when adding team members to an initally created team folder via http endpoint

I'm making REST calls to the DBX HTTP endpoint from within SAP. My app has full dbx access and all possible rights.
Creating a team folder works flawlessly but when trying to add members to that folder via the /sharing/add_folder_member API I get a strange error:

Error in call to API function "sharing/add_folder_member": Invalid authorization value in HTTP header "Authorization": "Basic <some base64 string>"
Expecting "Bearer <oauth2-access-token>"

I do provide an bearer oauth2 access token for app authentication (app ) and my user id (as admin) for the "Dropbox-API-Select-Admin" header parameter.
Also a list of users to be added to the team folder.
As soon as I make the REST call something unexpected happens: A popup window appears and I have to enter my dbx credentials.
After that above error occurs.

Things I don't get at all:
- why I have to authenticate myself as admin since an app access token is provided and the app has full dbx access and all possible rights?
- why the bearer token is ignored?

How can I fix this? Please advise.

Thanks,
Jan

 

P.S.: I just tried to access the endpoint using curl

 

curl -X POST https://api.dropboxapi.com/2/sharing/add_folder_member \
--header 'Authorization: Bearer <created access token using refresh token>' \
--header 'Dropbox-API-Select-Admin: dbid:<my team member  id>' \
--header 'Content-Type: application/json' \
--data '{"shared_folder_id":"<team folder id>","members":[{"member":{".tag":"dropbox_id","dropbox_id":"dbid:<my user id>"},"access_level":{".tag":"editor"}}],"quiet":false,"custom_message":"Test"}'

 

and got "missing scope ..." and "required scope sharing/write"

 

  • 1575475 Apologies for the lack of clarity here. For team folders in particular, you need to add members via groups; you can't add them individually. I'll ask the team to see if we can clarify this in the documentation and error response.

     

    For example, you would set the "members" parameter like:

    "members":[{"member":{".tag":"dropbox_id","dropbox_id":"GROUPIDHERE"}}]

     You can get group IDs from /2/team/groups/list, etc.

18 Replies

Replies have been turned off for this discussion

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!