Conversation participants are assigned IDs based on whether they've provided contact information or registered as a site member. The typical lifecycle is anonymous visitor > contact > site member, although it's possible to skip a step or to become a contact and site member at the same time.
Type | ID property | Details |
---|---|---|
Anonymous visitor | anonymousVisitorId | When the participant first opens the site, they're an anonymous visitor. |
Contact | contactId |
|
Member | memberId |
|
Behind the scenes, when a participant changes type, a new conversation is created and the previous conversation is merged into the new one. Before sending a message, you can ensure you're using the most current conversation ID by calling Get or Create Conversation with the participant's visitor, contact, or member ID.
The sections below tell you how your app can get the relevant ID to use the Inbox API.
Anonymous visitor IDs are available to your app
only after the visitor sends a message to the business using the
Message Sent To Business Webhook.
The ID is available at actionEvent.body.message.sender.anonymousVisitorId
.
When a visitor provides contact details to the site, they're converted to a contact. Once this happens, the ID used to access the visitor's conversations changes to the contact ID:
actionEvent.body.message.sender.contactId
.If the visitor is a site member, the conversation must be accessed using the member ID:
actionEvent.body.message.sender.memberId
.