Testing API call - receive error 400

SOLVED
Go to solution
New Contributor

Testing API call - receive error 400

Hi all,

 

I'm doing some initial testing of an API call, just trying to get a new integration working.  I'm new to the Box API...

 

I have a solution I'm creating (it is NOT a web-based app, but has the capability to set cURL options and call URLs).  I *think* I have my Post data object correct...but, my initial tests were resulting in an Error = 400 response.  Unfortunately, I can only read the response Header on this platform, not the response Body - so I can't see detailed error messages.

 

So I switched over to using Postman, just to try and get some basic tests working.  I am also getting a 400 error over there - but the detailed message says that it is a bad 'grant_type'...but it really looks like I have correctly defined & populated the 'grant_type'.

 

Here's an example of the Postman call... yes, a couple of the keys are empty, but I get the same result even when they are filled in; I have also tried this call with Grant_type = 'authorize', and get the same error.

 

Screen Shot 2020-06-12 at 11.58.10 .png

Thanks for any hints or guidance on how I could get this working.

 

J

3 REPLIES 3
Highlighted
Box Employee

Re: Testing API call - receive error 400

@jdatasol I think you are sending the parameters as headers instead of as form fields.

 

I'd recommend downloading our official Box Postman collection, as it has all these fields preconfigured for you already:

 

https://developer.box.com/guides/tooling/postman/quick-start/

 

Meanwhile though, here is what my configuration for refreshing an access token looks like:

 

Screenshot 2020-06-15 at 09.03.35.png

Ignore the environment variables ({{variable}}), you can put your own values in those fields.


---
Developer Advocate @ Box
Highlighted
New Contributor

Re: Testing API call - receive error 400

Doh!  Yep, that was it. I figured it had to be something simple - I totally missed that nuance, obviously.

 

Thanks!

Highlighted
Box Employee

Re: Testing API call - receive error 400

No problem, here to help.


---
Developer Advocate @ Box