Need to see if your shared folder is taking up space on your dropbox 👨💻? Find out how to check here.
Forum Discussion
Leon_NAM
5 years agoHelpful | Level 5
API Call using Integromat returns error
Hey there,
I want to create an automated API Call to our company's Dropbox that creates a folder with only select user groups having access. To do that I am using the Dropbox "Make an API Call"...
Leon_NAM
5 years agoHelpful | Level 5
Hey,
thanks for the replies. You are both right of course. Just saying "there is a [409] no_permission/.. error" is hardly enough information to go on. Sadly integromat does not supply any further information on the error...
My input is the same as last time:
URL
/2/sharing/share_folder
Body
{ "path": "/not a machine cloud/projekte/2021/21012 - casefilm google barklaycard - acht - jm/test", "acl_update_policy": "editors", "force_async": false, "member_policy": "team", "shared_link_policy": "members", "access_inheritance": "no_inherit" }
Dropbox API Endpoint
api
Method
POST
Headers
Key
Content-Type
Value
application/json
Disable Dropbox API Path Root
false
Any idea where I could start looking to get to the bottom of this?
Здравко
5 years agoLegendary | Level 20
Leon_NAM wrote:
.... Just saying "there is a [409] no_permission/.. error" ...
Hi Leon_NAM,
Yes, sometimes the error message isn't too verbose. 🤷 It's clear though that some permissions are missing. Do you able to share the same folder, using web interface, in context of the same account? 🤔 Are you (as account) the folder owner? Do you have rights to do that? Is some other shared folder within the one you are trying to share or does 'test' folder reside within a shared folder?
- Leon_NAM4 years agoHelpful | Level 5
Hey Здравко ,
thanks for the hint. I was using the /share_folder call on a folder that was created by another team member and in it the call was supposed to create a folder called 'test'. I wanted to take this out of the equation for now as it might be fixed if I give the Integromat app more permissions in the dropbox but I can't access those preferences right now.
So what I did to test the actual API call is I went into the root folder (a folder I most definetely own) and executed the program. I do get a new error here (which I would say is a success!) and it reads: "[400] Error in call to API function "sharing/share_folder": request body: could not decode input as JSON". Did I do something wrong in the body of the call?
Here's my input:
URL/2/sharing/share_folderBody{ "path": "/not a machine cloud/test", "acl_update_policy": "editors", "force_async": false, "member_policy": "team", "shared_link_policy": "members", "access_inheritance": "no_inherit"}Dropbox API EndpointapiMethodPOST--Headers:KeyContent-TypeValueapplication/json--
Disable Dropbox API Path RootfalseThanks for all your help!- Greg-DB4 years ago
Dropbox Community Moderator
A "request body: could not decode input as JSON" should indicate that the request body the app is sending is not valid JSON, and so could not be parsed by the Dropbox API server as the parameters for the call. The body you showed here appears to be valid JSON though, and I can't reproduce the issue using it; can you double check that that's the exact value your client is sending? It may help to enable verbose output showing the actual raw HTTP request you're sending, if possible.
- Leon_NAM4 years agoHelpful | Level 5
Hey Greg-DB thanks for your response! I have decided to ditch the premade module and go for the regular "HTTP - Make an OAuth 2.0 request" module to try to make this call. This one actually gives me the same error but a lot more information on the input and output so here it goes (in place of <OAuth Code> I have put my token from the app console) :
Input:
[ { "ca": null, "qs": [], "url": "https://api.dropboxapi.com/2/sharing/share_folder", "data": "{ \"path\": \"/not a machine cloud/test\", \"acl_update_policy\": \"editors\", \"force_async\": false, \"member_policy\": \"team\", \"shared_link_policy\": \"members\", \"access_inheritance\": \"no_inherit\"}", "gzip": true, "method": "post", "headers": [ { "name": "Authorization", "value": "Bearer <OAuth Code>" } ], "timeout": null, "useMtls": false, "bodyType": "raw", "contentType": "application/json", "serializeUrl": false, "shareCookies": false, "parseResponse": false, "followRedirect": true, "useQuerystring": false, "followAllRedirects": false, "rejectUnauthorized": true }Output:
[ { "statusCode": 400, "headers": [ { "name": "cache-control", "value": "no-cache" }, { "name": "content-security-policy", "value": "sandbox allow-forms allow-scripts" }, { "name": "x-content-type-options", "value": "nosniff" }, { "name": "content-type", "value": "text/plain; charset=utf-8" }, { "name": "accept-encoding", "value": "identity,gzip" }, { "name": "date", "value": "Thu, 16 Dec 2021 12:48:46 GMT" }, { "name": "server", "value": "envoy" }, { "name": "content-length", "value": "98" }, { "name": "x-dropbox-response-origin", "value": "far_remote" }, { "name": "x-dropbox-request-id", "value": "66fdbaa00e7f4eccbc5f1d3d78199118" }, { "name": "connection", "value": "close" } ], "cookieHeaders": [], "data": "Error in call to API function \"sharing/share_folder\": request body: could not decode input as JSON", "fileSize": 98 } ]
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!