Box Drive REST API Upload

Hi all,

I am trying to test out connecting a box drive to the application I am developing using Box's REST API. I set up all credentials and followed the Upload documentation (here). However, when I run it, I get a 400 code with a blank message. When I look in the response, It also states a 415 error of invalid file type (see attached).

I looked at the thread, but non seemed to resolve the issue.
documentation 1

I am not sure if this is a box issue, retool issue, or user issue (or a combination).


Hey @tspecht! Not sure off the bat what the issue is, but a couple of things to check.

  1. I'm sure you are setting the Authorization header on the resource setup screen, are you also setting the content-type header there as well? I don't see it set on the query itself.
    Screenshot 2023-11-08 at 3.32.53 PM

  2. Can you share what the {{report_submission_uploadFile.value['0']}} evaluates to? You may need to append .base64Data to that as it looks like the endpoint is expecting only the binary data of the file.

Let me know if that works!

Hi Joe,

Thank you for the reply!

I did set both content type and authorizations in the header, but still received a 400 error. The file value evaluated to the object showing the encoded base64 data, name, file type, and byte size. The Base64 data evaluated to a buffer data type, which I suspect to be the issue since, as you stated, it is expecting binary data. I am unsure how to transform from a buffer to binary data type in Node.Js.

Note: Played a round some more. I reworked the request base URL and authorization. I am now getting most of the way. However, now I am getting an error stating that I am missing a parent id, although on is supplied. I see in the documentation that a parent object is required, but I am not sure how to do that with form data.

@tspecht Can you share a screenshot of your current setup?

Got it to work finally. I had to change the keys to a single body entry and format it as a JSON object.