Answered

In order to connect to the REST API, do we need to sign the query, for example HMAC SHA256?

  • 29 September 2021
  • 9 replies
  • 216 views

Even the example from the help guide (yes, I did enter the API token) doesn't work:

curl https://api.intercom.io/articles -X GET -H 'Authorization:Bearer <Your access token>' -H 'Accept:application/json' -H 'Content-Type: application/json'

 

Returns the following error:

{"type":"error.list","request_id":"001iuuadd47ehouu9ndg","errors":[{"code":"unauthorized","message":"Access Token Invalid"}]}

icon

Best answer by Sam 30 September 2021, 22:36

View original

9 replies

Badge +1

Are you sure you copied the entire access token? It is case sensitive and common for people to miss the = symbol off of the end when copying the Access token from the OAuth page.

Hi, yes the whole token is copied and pasted (case integrity is intact), but I’m not using OAuth as my app is not (and will never be) public.

I'm beginning to suspect that all API calls use OAuth (which is not what the docs say - they imply OAuth is only used when creating a Public app).

Badge +1

You do not need to use OAuth for Private Apps.

 

You simply supply the Authorization header with the value: Bearer <Your Access Token>

 

Have you double checked that the token is 100% correct and that you're requesting the data for a workspace in which you own?

cURL Request that results in "Invalid API Token" error 

Hi Sam, thanks for your replies, but it doesn't work for me.

Not in a LINUX terminal, Python or Google Sheets.

 

If I can't get the example to work to simply retrieve a list of articles with a GET request with cURL, then I am dead in the water.

 

24 hours and still waiting for support to get back to me on this.

 

It would help to have more specifics in the documentation about this as the error code is not giving me much to work with.

Badge +1

Usually access tokens end in a =, are you sure you've copied the whole token from the site?

Hi Sam, you were right about the "=" - I usually double left-click to highlight text to be copied and it left off the "=" :/

 

Unfortunately still no luck (same error):

 

Ho hum...

Badge +1

I cannot reproduce this.

 

The only thing I can assume is your Authorization header is incorrect, as I have attempted to use this endpoint myself just now and it has worked perfectly.

Just to confirm, you ran this command (with your Auth Token) on Linux and it worked for you?

 

curl https://api.intercom.io/articles -X GET -H 'Authorization: Bearer <Your access token>' -H 'Accept: application/json' -H 'Content-Type: application/json'

 

If so, it might be something odd with RaspberryPi OS (although it's handled more complicated cURL than this for other development tasks).

Reply