We are aware of the issue with the badge emails resending to everyone, we apologise for the inconvenience - learn more here.

Forum Discussion

Shobhit_Sharma's avatar
Shobhit_Sharma
New member | Level 2
7 years ago

Dropbox Api throwing error, "request body: could not decode input as JSON"

Whenever I use https://api.dropboxapi.com/2/sharing/get_file_metadata  with apex code or postman, I receive an error message i.e., Error in call to API function "sharing/get_file_metadata": request b...
  • Greg-DB's avatar
    7 years ago

    It looks like you're sending the API parameters in a header with the name "data" in this line:

     

    r.setHeader('data','{ "file" : "id:ooT7g_X2tkAAAAAAAAAAEw" ,"actions" : [] }');
    

    The /2/sharing/get_file_metadata endpoint is an "RPC" style endpoint, so the parameters should be sent as JSON in the request body, not as a header. Update your code to send the JSON in the body instead of a header.

    I can't offer help with programming in Apex itself, but it looks like you may need to use the `setBody` method.