Skip to main content
Question

cannot upload a file to the Box

  • May 23, 2025
  • 1 reply
  • 12 views

Forum|alt.badge.img

Request: In an integration workflow I am using the box API to upload a file created from previous action/step.

- Auth Credentials are good. When I test, I can see that status as connected and updating the developer token as well when it got expired.

- Upload URL:  POST: https://upload.box.com/api/2.0/files/content

- Gave the file reference and file name from the previous action.

- And under data fields [ attributes] I gave [{"parent":{"id":"0"}}] because trying to upload the file to the root folder."

But I see the below response and not sure what to provide and where to provide the file content. New to API's. please help.

 

Error: Bad Request, responseBody: {\"type\":\"error\",\"status\":400,\"code\":\"bad_request\",\"context_info\":{\"errors\":[{\"reason\":\"missing_parameter\",\"name\":\"file_data\",\"message\":\"'file_data' is required\"}]},\"help_url\":\"http:\\/\\/developers.box.com\\/docs\\/#errors\",\"message\":\"Bad Request\",\"request_id\":\"ead47khe0gpujnec\"} ",
  "statusCode": "BAD_REQUEST",
  "statusCodeValue": 400

1 reply

Forum|alt.badge.img

I had this same issue when I first started using the Box API. When I added the name portion to the attributes, the error went away. So, the name tag is required actually. {name: 'testFile.pdf', parent: {id: 0}}.