Trying to list team root folders using this request from the namespace guide:
curl -X POST https://api.dropboxapi.com/2/files/list_folder \
--header "Authorization: Bearer <token>" \
--header "Content-Type: application/json" \
--header 'Dropbox-API-Path-Root: {".tag": "root", "root":"<namespace_id>"}' \
--data '{"path":""}'
This works from the console. However, when using inside a Browser using xhr, i am running into a CORS problem:
Failed to load https://api.dropboxapi.com/2/files/list_folder:
Response to preflight request doesn't pass access control check:
No 'Access-Control-Allow-Origin' header is present on the requested resource.
Origin 'http://localhost:7331' is therefore not allowed access.
The response had HTTP status code 400.
The request will work for any other folders, it seems the problem lies within the custom header (Dropbox-API-Path-Root)
Is there any way to solve this? Thank you in advance 