Is there a supported way to send a proactive notification to a guest who has an active session from a previous interaction? We are building a custom agent desktop extension using the Embeddable Client App SDK. The goal is to identify customers who visited last week and send them a follow-up message if they come back today.
I tried using the createInteraction endpoint with the guestId from the previous session. The call returns a 200 OK, but no message appears in the guest’s browser. I checked the network tab and the payload looks correct. The guest is technically ‘new’ to the system since the previous session expired, but I want to link it.
Here is the code I am using in the Node.js backend service:
const response = await fetch('https://api.mypurecloud.com/api/v2/interactions', {
method: 'POST',
headers: {
'Authorization': `Bearer ${accessToken}`,
'Content-Type': 'application/json'
},
body: JSON.stringify({
"type": "webMessaging",
"direction": "inbound",
"channel": "webMessaging",
"guest": {
"id": "prev-session-guest-id-123",
"name": "John Doe"
},
"message": "Welcome back! How can we help?"
})
});
The response gives me a new interaction ID. I then try to push the message using the interaction API. It seems to work silently but the frontend SDK doesn’t receive the event. I see this in the console when initializing the guest SDK:
[WebMessaging] Guest initialized. Session ID: new-session-xyz
[WebMessaging] No pending interactions found.
Is this the right approach? I feel like I am missing a step to bridge the old guest ID to the new session. The documentation on guest persistence is sparse. Maybe I need to use a different API to update the guest profile first? I don’t want to spam the user with a new session if they are just reloading the page. What is the standard pattern for this?