Skip to main content
Answered

Manage companies from messenger


Hi,

 

We have the messenger installed on our website and we now need to 1) create the companies available in our product 2) associated the users to each company.

I know that both points are possible via the intercom API but I was wondering if these two steps can be achieved directly by passing the company_id and name (for 1) and some sort of link in the payload sent by the messenger like we do for the user_data:

user_data{"email":"myemail@google.com","user_id":"github|blabla","user_hash":"d5c0534625a6ec7ad75bc5b2a9f231b1febb226ff37bde15df3e6693c0130677"}

it’s probably not the most secure way but I was wondering if it’s something that can be done instead of doing all this back-end side

 

 thank you

Best answer by Jacob Cox

Hi @Alessandro Carrano !

You can create a company and associate a user with it all in one go by using our Intercom installation snippet for Users. When a user logs into your app you’ll also log them into Intercom with the installation snippet. If you pass a company object over in that installation snippet with the Company ID and Name, it will create the Company in Intercom (if it’s not created yet), and associate that User with the company. NOTE: You need to make sure you include BOTH the Company’s ‘id’ attribute along with it’s ‘name’ attribute in order for this to work.

You can read up more about this in our article on the topic, here!

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

2 replies

Jacob Cox
Intercom Team
Forum|alt.badge.img+5
  • Sr. Technical Support Engineer
  • 441 replies
  • Answer
  • March 30, 2024

Hi @Alessandro Carrano !

You can create a company and associate a user with it all in one go by using our Intercom installation snippet for Users. When a user logs into your app you’ll also log them into Intercom with the installation snippet. If you pass a company object over in that installation snippet with the Company ID and Name, it will create the Company in Intercom (if it’s not created yet), and associate that User with the company. NOTE: You need to make sure you include BOTH the Company’s ‘id’ attribute along with it’s ‘name’ attribute in order for this to work.

You can read up more about this in our article on the topic, here!


thanks for your answer!


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