Expected authorization in headers, but none provided. | XM Community
Skip to main content
Solved

Expected authorization in headers, but none provided.


Hello
I'm just starting to work with Qualtrics API and am getting these errors using cUrl:
>curl -H "X-API-TOKEN ###" -X GET https://ca1.qualtrics.com/API/v3/whoami 
{"meta":{"httpStatus":"400 - Bad Request","error":{"errorMessage":"Expected authorization in headers, but none provided.","errorCode":"ATP_2"},..
>curl -H "Authorization:bearer ###" "https://ca1.qualtrics.com/API/v3/whoami"
{"meta":{"httpStatus":"403 - Forbidden","error":{"errorMessage":"insufficient_scope","errorCode":"AUTH_13.0"},...
In the second case I gave my client all available scopes!
Any help is greatly appreciated!
Thank you!

Best answer by shlasasha

In the first case colon is missing after X-API-TOKEN
>curl -H "X-API-TOKEN: ###"  ...

IN the second case need to include scope when requesting token.
>curl -X POST -d "grant_type=client_credentials&scope=manage:all" ...

View original

4 replies

Mishraji
Level 4 ●●●●
Forum|alt.badge.img+18
  • Level 4 ●●●●
  • 236 replies
  • May 5, 2021

This error is because you are not providing the correct X-API-TOKEN in the cUrl. I tried this out in Postman and was able to successfully get user details.


  • 2 replies
  • Answer
  • May 5, 2021

In the first case colon is missing after X-API-TOKEN
>curl -H "X-API-TOKEN: ###"  ...

IN the second case need to include scope when requesting token.
>curl -X POST -d "grant_type=client_credentials&scope=manage:all" ...



Mishraji
Level 4 ●●●●
Forum|alt.badge.img+18
  • Level 4 ●●●●
  • 236 replies
  • May 6, 2021

Are you trying it in this format? The highlighted part should be replaced by your Qualtrics API TOKEN.
image.png


Leave a Reply