Per the docs https://doc.airvantage.net/av/reference/cloud/API/ section “Authenticating an API Client”
I am not able to determine how to properly set this header, or where this code value is derived from
grant_type=authorization_code&code=1JV6zV&
Is there a better example somewhere, or, can anybody shed light or provide more details on how to properly obtain the correct value for the “code” parameter, and how to include all this in the headers of the request? Thanks
Examples on what I’ve tried so far:
Pre Conditions for all requests:
*the key and secret for the particular client are concatenated into a string, separated by a : which is then base64 encoded, and used as the value for the Authorization header, prepended by Basic and a space, as shown.
- The request is a post type
- the Content-Type header is set to application/x-www-form-urlencoded
- Url is: https://na.airvantage.net/api/oauth/token
I’ve tried creating a header for the entire grant_type, where grant_type is the key, and everything to the right of that (in the docs) is the value, like: grant_type : authorization_code&code=1JV6zV& This results in response of {“error”:“invalid_request”,“error_description”:“Missing parameter grant_type”}
I’ve tried splitting grant_type=authorization_code&code=1JV6zV& into two different headers, for grant_type and code, also results in {“error”:“invalid_request”,“error_description”:“Missing parameter grant_type”}
I’ve tried using query parameters in the URL, as: https://na.airvantage.net/api/oauth/token?grant_type=authorization_code&code=1JV6zV& which results in {“error”:“invalid_grant”}
And finally, including the grant_type=authorization_code&code=1JV6zV& in the body of the request, which results in: {“error”:“invalid_request”,“error_description”:“Missing parameter grant_type”}