vbouet
1
Hello, here is my call
and when i try it i got a error message “Raw response for the API
Status code 400
{“error”:“invalid_request”,“error_description”:“The request is missing a required parameter, includes an invalid parameter value, includes a parameter more than once, or is otherwise malformed. Request parameter ‘grant_type’ is missing”}”
i tried this call in Postman and it worked
anyone can help ?
The value of “authorization_code” is empty ?
vbouet
3
here is the documentation of the call
Grant_type should be a string “Authorizatiob_code” and that what i set in my call.
I don’t undertsant why he said grant_type is missing …
That’s great ! Your parameters look correct, but maybe in your specific call the value of “authorization_code” being set as the “grant_type” is empty ?
vbouet
5
what do you mean by “is empty” ?
This means that “authorization_code” in your call has no value
Jici
7
Reason why it’s not working is because you are sending a JSON while API expect x-www-form-urlencoded (like you did in postman)
remove your JSON body, use parameters instead, check the querystring checkbox for each element and add the header for Content-type: application/x-www-form-urlencoded
vbouet
8
now it tell’s me “post body can not be empty”
Jici
9
So this is because it won’t read the url encoded with querystring (most api will accept it but not all).
In this case, you need to do that:
Put all your parameters into the body JSON, but instead as json, set it as
grant_type=authorization_code&code=yourcode&… (all key,value pair separated with &)
Jici
10
Another solution is to use the “raw” type instead and uncheck querystring
vbouet
11
ok guys, with your helps, i founded the solution
just need to set body type as Form-data
1 Like
Jici
12
All API are differents and could accept different thing. However, the form-data is another type of request. Nice that you found it
system
Closed
13
This topic was automatically closed after 70 days. New replies are no longer allowed.