Answered

Is there a bug in your message API?

  • 2 February 2023
  • 5 replies
  • 99 views

Hi there,

I am trying to leverage the messages endpoint (https://api.intercom.io/messages and send an email using Intercom, with the template 'plain'. However, it seems like the 'message_type' body parameter is not working, since I send it and it generates an in-app message instead of an email. Here is the body of my request:

{
"message_type": "email",
"subject": "Hey",
"body": "test",
"template": "plain",
"from": {
"type": "user",
"id": "63db09ccde07bab99d849eb0"
},
"to": {
"type": "user",
"id": "630e7f6692c1ab99a7ef98af"
}
}

And here is the response I am getting:

{
"type": "user_message",
"id": "1585218670",
"created_at": 1675374629,
"subject": "Hey",
"body": "test",
"message_type": "email",
"template": "personal",
"conversation_id": "187969400000608"
}

 

No email, but rather an in app message:

 

Screen Shot 2023-02-02 at 1.53.06 PM 

Can you address this? thank you

icon

Best answer by mateusz.leszkiewicz 12 March 2024, 15:54

View original

5 replies

Userlevel 4
Badge +5

Hey @user1636​ Racheal from the support engineer team here👋 

 

This is actually working as expected, you can see it is sent as an email by the icon here:

Screenshot 2023-02-06 at 7.20.03 PMHowever, your from object should always be from admin not user. We mention this here.

 

@racheal​ thanks for your reply. I do see the icon, yet I am not able to send it in an email. What I want to achieve is to send this message via email so a customer/lead will open it via their email account and not intercom. Similar to how I do it with the 'outbound' section of the product. Is there a way to do it?

 

Userlevel 4
Badge +5

Hey @user1636​ 

 

Of course, that is just what this endpoint does! Just as when you send an email from Outbound it still lives in your Intercom platform, so will this email. You will be able to view the email from the user's profile page.

 

The end-user will receive it in their email client. In this example you are sending the email from the end-user, this should always be sent from an admin. Can you give that a try?

I do have the same query. I put the parameter type “admin” on the from object but it says that `invalid parameter`.

I tried different approach we put a message_type of email but the response is always message_type is `inapp`, Yes it is on the profile, but we dont have the email icon that message, also the Leads or User did not actually receives any email coming from the API.

 

Userlevel 2
Badge +3

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

The proper syntax of the email message send API request is like the one below:

 

Please let me know if that was the answer you were looking for 😎

Reply