Skip to main content
Answered

How do I know which user is hitting my express.js API?


I have created an app for Messenger . The app integrates to the messenger after installation from marketplace. Lets say i have 10 users who installed my app. When they click on the app in messenger , how do i know which user is hitting my express.js api .

 

Is there any token stored by Intercom while installing the app ? If yes, does it include this token while hitting my api?

Best answer by Anonymous

Hey @narendra​ - when someone installs your app, you will have to have https://developers.intercom.com/building-apps/docs/setting-up-oauth"alt="http://https://developers.intercom.com/building-apps/docs/setting-up-oauth"target="_blank">fetched their Access Token through OAuth. The Access Token is linked to a workspace. You can make a call to `https://api.intercom.io/me`to https://developers.intercom.com/intercom-api-reference/reference#view-the-current-admin"alt="http://https://developers.intercom.com/intercom-api-reference/reference#view-the-current-admin"target="_blank">identify the current admin and workspace.

 

When someone uses a Canvas Kit app, as part of each request payload we give the workspace/app_id who made the call. https://developers.intercom.com/building-apps/docs/canvas-kit#section-requests-responses"alt="http://https://developers.intercom.com/building-apps/docs/canvas-kit#section-requests-responses"target="_blank">More here in the Canvas Kit docs.

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

2 replies

  • Author
  • New Participant
  • 1 reply
  • October 8, 2020

Hi @Zach Read​  Can you provide some insights on this please.


  • 0 replies
  • Answer
  • October 8, 2020

Hey @narendra​ - when someone installs your app, you will have to have https://developers.intercom.com/building-apps/docs/setting-up-oauth"alt="http://https://developers.intercom.com/building-apps/docs/setting-up-oauth"target="_blank">fetched their Access Token through OAuth. The Access Token is linked to a workspace. You can make a call to `https://api.intercom.io/me`to https://developers.intercom.com/intercom-api-reference/reference#view-the-current-admin"alt="http://https://developers.intercom.com/intercom-api-reference/reference#view-the-current-admin"target="_blank">identify the current admin and workspace.

 

When someone uses a Canvas Kit app, as part of each request payload we give the workspace/app_id who made the call. https://developers.intercom.com/building-apps/docs/canvas-kit#section-requests-responses"alt="http://https://developers.intercom.com/building-apps/docs/canvas-kit#section-requests-responses"target="_blank">More here in the Canvas Kit docs.


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