Answered

Requesting contact by its ID via API - Not Found error

  • 20 July 2023
  • 1 reply
  • 36 views

Using the legacy users API endpoint, I can lookup a user by its User ID:

```
In [36]: INTERCOM_API._wrapped_api._session.get("https://api.intercom.io/users?user_id=64b9893ad6e27c3ffdeda313").json()['id']
Out[36]: '64b9893b1c83c9c6ed44a05c'
```

The same ID I see in the UI, all good:

But when I’m trying to access this user (contact?) using the new API, I get 404:

```

In [37]: INTERCOM_API._wrapped_api._session.get("https://api.intercom.io/contacts/64b9893b1c83c9c6ed44a05c").json()
Out[37]:
{'type': 'error.list',
 'request_id': '001lpi4kfnoevvqlhh30',
 'errors': [{'code': 'not_found', 'message': 'Contact Not Found'}]}

```

Please advise.

icon

Best answer by Eden 27 July 2023, 01:21

View original

1 reply

Userlevel 3
Badge

Hey @Anton Koval 👋 Eden from the support engineer team here.

 

Can you confirm that you are using the correct access token for the app that you are making this request to? You will want to make sure that the access token doesn’t show a warning that it needs an update as well. 

 

To locate the access tokens for your workspace, go to the Developer Hub and then navigate to Your Apps.


Here you'll find a list of all the apps you've built, including the workspace the app is installed on and the production workspace's access token. Once you've located the correct app, you'll want to click on the app's name. This will take you to the app's basic information view, like this 👇


To update the access token associated with that app in your workspace, you'll need to navigate to Test and Publish > Your workspaces:

 

There you will see the ability to regenerate the access token for that app that is connected to your workspace, if needed. 👍

Reply