02-22-2018 08:59
02-22-2018 08:59
I am having trouble retrieving token state using cURL in PHP.
I am submitting headers:
Authorization: Bearer <Access Token>
Content-Type: application/x-www-form-urlencoded
The response is:
"The [Content-Type: application/x-www-form-urlencoded] header is required by this endpoint."
Output of curl_getinfo($ch, CURLINFO_HEADER_OUT) is:
POST /oauth2/introspect HTTP/1.1
Host: api.fitbit.com
Accept: */*
Authorization: Bearer <Access Token>
Content-Length: 393
Expect: 100-continue
Content-Type: application/x-www-form-urlencoded; boundary=------------------------4ea27c362eabb08c
I am at a total loss here, I AM sending the Content-Type header but the API is not recognizing it.
I have successfully requested and gotten a token from authorization code using the same Content-Type header.
Everything indicates that I am sending the appropriate headers but the API is not recognizing them.
Any help would be greatly appreciated.
Answered! Go to the Best Answer.
02-22-2018 10:31
Fitbit Developers oversee the SDK and API forums. We're here to answer questions about Fitbit developer tools, assist with projects, and make sure your voice is heard by the development team.
02-22-2018 10:31
@DonDickinson , the response that you're getting says that the header should look like
"Content-Type: application/x-www-form-urlencoded".
I see based on your output your Content-Type header looks different and it has extra data at the end.
Try to remove this extra piece at the end " boundary=------------------------4ea27c362eabb08c"
Best Answer02-22-2018 10:31
Fitbit Developers oversee the SDK and API forums. We're here to answer questions about Fitbit developer tools, assist with projects, and make sure your voice is heard by the development team.
02-22-2018 10:31
@DonDickinson , the response that you're getting says that the header should look like
"Content-Type: application/x-www-form-urlencoded".
I see based on your output your Content-Type header looks different and it has extra data at the end.
Try to remove this extra piece at the end " boundary=------------------------4ea27c362eabb08c"
Best Answer