Cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Get Access Token with Content-Type JSON

ANSWERED

Is it possible to send an Access Token Request using a JSON body instead of x-www-from-urlencoded? I can use x-www-from-urlencoded, but it seems JSON would be more consistent with making REST requests from a back-end process.

 

I tried but I get a 400 with an error message that I need to use x-www-from-urlencoded.

 

If not, curious - Is it a requirement of the oAuth 2 spec to use x-www-from-urlencoded?

 

Thanks,

Jeff Humphry

Best Answer
0 Votes
1 BEST ANSWER

Accepted Solutions

Hi @Jeff_New_Ocean 

 

It is not possible to send the parameters for an access token request using a JSON body.  As described in the RFC 6749 specification, "

The client makes a request to the token endpoint by adding the
   following parameters using the "application/x-www-form-urlencoded"
   format...

Please see the specification linked above for the complete description.

Gordon Crenshaw
Senior Technical Solutions Consultant
Fitbit Partner Engineering & Web API Support | Google

View best answer in original post

Best Answer
0 Votes
1 REPLY 1

Hi @Jeff_New_Ocean 

 

It is not possible to send the parameters for an access token request using a JSON body.  As described in the RFC 6749 specification, "

The client makes a request to the token endpoint by adding the
   following parameters using the "application/x-www-form-urlencoded"
   format...

Please see the specification linked above for the complete description.

Gordon Crenshaw
Senior Technical Solutions Consultant
Fitbit Partner Engineering & Web API Support | Google
Best Answer
0 Votes