What is this?
Dexra integrates with Instagram Direct Messages (DMs) and Facebook Messenger to bring all your social interactions into one unified inbox. This means you can reply to customer questions, story mentions, and comments without switching between apps.
For developers, this integration treats social messages just like any other conversation, allowing you to use webhooks and APIs to build custom workflows.
Developer Documentation
This section explains behavior, events, and integration patterns for developers.
1. Channel Overview
From a technical standpoint:
- Both channels are treated as messaging conversations.
- Messages are unified into the Dexra inbox.
- Incoming and outgoing messages trigger webhook events.
- Conversations can be linked to existing users when identity matches (email/phone).
2. Message Flow
Incoming Message (User → Dexra)
- User sends a DM on Instagram or Messenger.
- Meta delivers the message to Dexra.
- Dexra creates/updates a conversation, associates the message with a user, applies automations, and triggers webhooks.
Outgoing Message (Dexra → User)
- Agent, automation, or backend sends a reply via Dexra.
- Dexra delivers the message via Meta APIs.
- Message appears in the user’s inbox.
3. User Identity & Matching
Users are identified by channel-specific IDs:
- Instagram: Instagram User ID (scoped to app).
- Messenger: Facebook Page-scoped User ID (PSID).
Best Practice: Identify users on your website using
SBUser as early as possible so Dexra can unify their social identity with their email profile if they ever click a link from chat.4. Webhook Events
Common events include message_in and message_out. Always check the channel field.
{
“event”: “message_in”,
“channel”: “instagram”,
“timestamp”: “2023-10-25T14:22:10Z”,
“data”: {
“conversation_id”: “54321”,
“user”: {
“id”: “IG_998877”,
“username”: “customer_handle”
},
“message”: {
“id”: “MSG_112233”,
“content”: “Is this product available?”,
“type”: “text”
}
}
}
5. Platform Rules & Limitations
- Messaging Windows: Meta enforces a 24-hour reply window. Automation cannot send messages outside this window unless utilizing specific tags (which Dexra handles where possible).
- Sending Messages: Never send messages directly to Meta APIs. Always use Dexra’s API to ensure the conversation history remains consistent.