Skip to main content
Question

Got "Bad Request" as parent is required using API Call in API Reference.

  • May 22, 2025
  • 3 replies
  • 20 views

Forum|alt.badge.img

Hi,

 

I want to try using the API Call in this website API reference for creating new folder

but instead I got the Bad Request saying that parameter is missing due to parent is required.

In developer mode, the console keep showing that 

 

Click to expand
Request.js:37 POST https://api.box.com/2.0/folders/ 400 (Bad Request)

Is there anyway I can successfully do the API call via the API site ?  

3 replies

Forum|alt.badge.img
Click to expand
Hi   - You likely tried to create a folder without specifying a parent folder id. If you want to create a folder in your 'root' - i.e. the view you see when you first log in, you use id = 0.  For example:

curl --location --request POST 'https://api.box.com/2.0/folders' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer mytoken' \
--data-raw '{
  "name": "A New Folder",
  "parent": {
    "id": "0"
  }
}'​


I suggest you check out the Postman collection as it has many examples of properly formatted API calls

https://developer.box.com/guides/tooling/postman/


Forum|alt.badge.img

Thank you for your answer. I did try setting root folder id already but it's still kept showing the 400.

 

BOX_r0jzwxltquijcyayrj0vdxpynuw0kmov.png

 

 

 

BOX_6otcxderjh250g9crdhp6yy3bgb78zid.png

 

 


Forum|alt.badge.img

Hey  - It looks like this may be a problem with our documentation site. I was able to reproduce the same error and it looks like the browser is not actually sending the parent folder id when it sends the API request. I've logged a request with our developer relations team to look into this, but in the mean time I suggest you use our Postman collection to experiment with the API.

 

https://developer.box.com/guides/tooling/postman/