You might see that the Dropbox Community team have been busy working on some major updates to the Community itself! So, here is some info on what’s changed, what’s staying the same and what you can expect from the Dropbox Community overall.
Forum Discussion
rubbermeetsrd
3 years agoExplorer | Level 3
Javascript responseError in call to API function "files/move:2"
I'm working on a google app script to move a pdf file from one folder in Dropbox to another. I have it working in Postman but am having trouble getting it to work in my google app script. I am gett...
Здравко
Legendary | Level 20
rubbermeetsrd wrote:... When I brought up the move_v2 api call, the template was set up as a raw body which worked.
...
I don't know what you mean 'raw body', but your 'template' seems correct. It should work. Why are you NOT calling 'move_v2' in the same way? 🤷 Take a look on your OP. Is it the same or not exactly? 🙂
Greg-DB
3 years agoDropbox Staff
rubbermeetsrd The /2/files/move_v2 endpoint is an "RPC" style endpoint, meaning it expects the parameters as JSON in the request body. The "request body: could not decode input as JSON'" error you're getting indicates that the request body did not contain valid JSON, and so the Dropbox API was unable to understand it.
You'll need to debug your code to make sure you're sending valid JSON in the request body. As Здравко noted, make sure you check which code you're running, as the code in your screenshot does not match the code in your original post. Specifically, one does convert the parameters to JSON using JSON.stringify, and one does not.
- rubbermeetsrd3 years agoExplorer | Level 3
I apologize if I confused my post by showing testing within postman. Ultimately, I was working to get a google app script to move a dropbox file from one folder to another. Everyone was correct, there was an issue with the response body. Given that I couldn't find an example of a google script that made this dropbox api call I was at a loss at to my issue. After much trial and error, I got it working. Here is the solution:
I changed data to payload and it worked. This was not obvious in the Dropbox api documentation. Hope this helps someone else in the future.
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
5,915 PostsLatest Activity: 6 hours agoIf 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 or Facebook.
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!