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"