Skip to main content
Question

404 on file upload with curl - documentation is incorrect?

  • May 27, 2025
  • 1 reply
  • 10 views

Forum|alt.badge.img

I had issues with file upload in box using the example provided in the documentation. I have a working solution now. My working solution uses a different url than the one provided in the document. Is the "https://api.box.com/2.0/files/content" url for uploading a file incorrect or broken? 

This is the example provided in the documentation: 

curl -i -X POST "https://api.box.com/2.0/files/content" -H "Authorization: Bearer REPLACE-WITH-BEARER-TOKEN" -H "Content-Type: multipart/form-data" -F attributes='{"name":"Contract.pdf", "parent":{"id":"REPLACE-WITH-FOLDERID"}}' -F file=@/Contract.pdf

 

This is the code that works: 

curl -X POST https://upload.box.com/api/2.0/files/content -H "Authorization: Bearer REPLACE-WITH-BEARER-TOKEN" -H "Content-Type: multipart/form-data" -F attributes='{"name":"Contract.pdf", "parent":{"id":"REPLACE-WITH-FOLDERID"}}' -F file=@Contract.pdf

1 reply

Forum|alt.badge.img
  • Author
  • Known Participant
  • 34746 replies
  • May 27, 2025

Hi there,

Our apologies, you're absolutely correct in that there was a mistake in the cURL samples of the documentation. I went ahead and adjusted the cURL samples to use the correct URI (upload.box.com).

- Jon