404 on file upload with curl - documentation is incorrect?
AnsweredI 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
-
Official comment
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
Comment actions
Please sign in to leave a comment.
Comments
1 comment