New messages
Get real-time updates on new messages using Unipile's Webhook.
Feature available for : LinkedIn, WhatsApp, Instagram, Messenger, Telegram, X (Twitter)
Unipile's New messages Webhook is a powerful feature that provides real-time notification on new messages, received or sent.
Sent messages are included in message_received, they can be sent by the connected user from another device or from API. You can compare "account_info.user_id" with "sender.attendee_provider_id" to know if linked Unipile account is the sender or not.
You will not receive webhooks for old messages upon account connection. However, in the case of reconnection, you will receive messages that arrived during the disconnection period.
Here is an example request payload:
{
"account_id": "dfXlh46vQYCsMbVarumWlg",
"account_type": "LINKEDIN",
"account_info":{"type":"LINKEDIN","feature":"classic","user_id":"ACoAAAcDMMQBODyLwZrRcgYhrkCafURGqva0U4E"},
"event": "message_received", // 'message_reaction' | 'message_read' | 'message_received'
"chat_id": "R8J-xM9WX7eoHLp6gSVtWQ",
"timestamp": "2023-09-24T13:49:07.965Z",
"webhook_name": "Webhook demo",
"message_id": "ykmhfXlRW0W_cqReJYrfBw",
"message": "Hello World !",
"sender": {
"attendee_id": "C8zaRZTlVcmfnke_Vai4Gg",
"attendee_name": "Kim Unipile",
"attendee_provider_id": "ACoAAAcDMMQBODyLwZrRcgYhrkCafURGqva0U4E",
"attendee_profile_url: "https://www.linkedin.com/in/ACoAAAcDMMQBODyLwZrRcgYhrkCafURGqva0U4E/",
},
"attendees": [
{
"attendee_id": "12Siz1Vcmfnke_Vai4Gg",
"attendee_name": "Bastien Unipile ",
"attendee_provider_id": "AA1212sqqsMQBODyLwZrRcgYhrkCafURGqva0U4E",
"attendee_profile_url": "https://www.linkedin.com/in/ACoAAAcDMMQBODyLwZrRcgYhrkCafURGqva0U4E/"
}
],
"attachments":
{
"id": "2-MTY5MzQ3ODM0MTgxOWI4MDA4My0wMDMmNjg2M2E2MTgtNjM2Yi01OWNkLWFjNmQtYjE3Y2NjNTU5ZWZkXzAxMw==",
"size": {
"height": "150",
"width": "150"
},
"sticker": "false",
"unavailable": "false",
"mimetype": "image/jpeg",
"type": "img",
"url": "att://iWfwCtGXSr288YQm5MbWVaeGtYNHQyaEZQcVpPbW5PdGNsQQ=="
},
"reaction": "😄", // only for event "message_reaction"
"reaction_sender": { // only for event "message_reaction"
"attendee_id": "C8zaRZTlVcmfnke_Vai4Gg",
"attendee_name": "Kim Unipile",
"attendee_provider_id": "ACoAAAcDMMQBODyLwZrRcgYhrkCafURGqva0U4E",
"attendee_profile_url: "https://www.linkedin.com/in/ACoAAAcDMMQBODyLwZrRcgYhrkCafURGqva0U4E/",
}
}
Updated 23 days ago