Skip to main content
Answered

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

  • September 29, 2021
  • 9 replies
  • 342 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"}]}

Best answer by Sam

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.

View original
Did this topic help you find an answer to your question?

9 replies

Forum|alt.badge.img+1
  • Active User
  • 95 replies
  • September 30, 2021

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.


  • Author
  • Connector
  • 7 replies
  • September 30, 2021

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.


  • Author
  • Connector
  • 7 replies
  • September 30, 2021

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).


Forum|alt.badge.img+1
  • Active User
  • 95 replies
  • September 30, 2021

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?


  • Author
  • Connector
  • 7 replies
  • September 30, 2021

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.


Forum|alt.badge.img+1
  • Active User
  • 95 replies
  • September 30, 2021

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


  • Author
  • Connector
  • 7 replies
  • September 30, 2021

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...


Forum|alt.badge.img+1
  • Active User
  • 95 replies
  • Answer
  • September 30, 2021

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.


  • Author
  • Connector
  • 7 replies
  • September 30, 2021

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


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings