Answered

Integration with an external API

  • 26 April 2024
  • 5 replies
  • 33 views

I am trying to integrate with an external API (ExtAPI) so that an agent can use an Inbox app to create data in it when in a conversation.

The agent has a login (username/password) in the ExtAPI. There is a login endpoint in the ExtAPI that returns a token and id for them. The agent may occasionally need to re-login.

I can’t work out how to allow the agent to be able to login into the ExtAPI and store the token and id in their session so that it will be passed in conversation details to the Inbox App. I presume I’ll need to create a login form but don’t know where to set/call this in Intercom.

Any advice would be appreciated.

 

icon

Best answer by mateusz.leszkiewicz 30 April 2024, 15:30

View original

5 replies

Userlevel 2
Badge +4

Hi ttbsr, It’s Mat from the Support Engineering Team 😀

This is very clever idea and I bet it will save you so much time.

I would recommend setting a custom action to get this done.
You can easily use it later on in a reusable workflow in the conversation with your customer.

I hope this will help you find an ideal setup for your needs.

I see that a custom action can take templated variables and can be run from a conversation but how would you suggest the teammate/agent set the username and password that goes into the login api call? 

I don’t see where a login form could be displayed.

Userlevel 2
Badge +4

Hi ttbsr, 
You can store the API token to access your database securely in the Intercom when you setting up a Custom Action.
To extract the data about your customer, I presume that you’ll need the unique id of the user (which can be stored as an attribute in the contact data of the user).

Does that make sense to you?

Thanks for your message but I’m missing something here. The agent who is going to use the inbox app needs to send their credentials  to get an api token for the external api. I just don’t see how the user can enter their username and password in a form to get the api token which can be stored in intercom. Where would a login screen sit?

Userlevel 2
Badge +4

Hi ttbsr, It seems that you need a more complex solution to your setup.
Can you please reach out to us via Messenger in your workspace to figure that out?
Custom actions are fairly complicated to set up. usually there is a need to consult your developer resources to make it work properly.

Reply