I am developing a custom Messenger user interface using the Headless Mode SDK and have created an HTML page for its integration. The conversation is successfully routed to Genesys Cloud, and the agent receives the interaction. However, the conversation between the agent and the customer is not initiating as expected.
I can see the configuration received in my console logs;
Configuration Received
- {id: '****', version: '9', headlessMode: {…}, languages: Array(1), defaultLanguage: 'en-us', …}
- apiEndpoint: "https://api.cac1.pure.cloud"
- auth: {enabled: false, allowSessionUpgrade: false}
- cobrowse: {enabled: false, allowAgentControl: true, allowAgentNavigation: true, allowDraw: true, maskSelectors: Array(0), …}
- customI18NLabels: []
- defaultLanguage: "en-us"
- headlessMode: {enabled: true}
- id: "***"
- journeyEvents: {enabled: false}
- languages: ['en-us']
- messenger: {enabled: true, apps: {…}, styles: {…}, launcherButton: {…}, fileUpload: {…}, …}
- position: {alignment: 'Auto', sideSpace: 20, bottomSpace: 12}
- status: "Active"
- version: "9"
- [[Prototype]]: Object
- constructor: ƒ Object()
- hasOwnProperty: ƒ hasOwnProperty()
- isPrototypeOf: ƒ isPrototypeOf()
- propertyIsEnumerable: ƒ propertyIsEnumerable()
- toLocaleString: ƒ toLocaleString()
- toString: ƒ toString()
- valueOf: ƒ valueOf()
- __defineGetter__: ƒ __defineGetter__()
- __defineSetter__: ƒ __defineSetter__()
- __lookupGetter__: ƒ __lookupGetter__()
- __lookupSetter__: ƒ __lookupSetter__()
- __proto__: (...)
- get __proto__: ƒ __proto__()
- set __proto__: ƒ __proto__()
The SDK ready function is working as expected. ✅ MessagingService.ready
Genesys("subscribe", "MessagingService.ready", () => {
console.log("✅ MessagingService.ready");
document.getElementById("startBtn").disabled = false;
});
Configure Conversation is also working => ✅ configureConversation
function configureConversation(retry) {
Genesys("command", "MessagingService.configureConversation", {},
(resp) => {
console.log("✅ configureConversation:", resp);
if (resp && resp.isSessionActive) {
console.log("▶️ Resuming session:", resp.conversationId);
isConversationActive = true;
} else {
startNewConversation();
}
},
(err) => {
console.error("❌ configureConversation error:", err);
if (!retry) {
console.log("🔁 Retrying configuration...");
resetAndConfigure(true);
}
}
);
}
startNewConversation is not trigger backend POST from Genesys Cloud.
function startNewConversation() {
console.log("🚀 Attempting to start a new conversation...");
try {
Genesys("command", "MessagingService.startConversation", {
channel: { type: "web" }
},
(resp) => {
console.log("✅ New conversation started:", resp);
isConversationActive = true;
},
(err) => {
console.error("❌ startConversation error:", err);
alert("❌ Failed to start conversation. Check console.");
});
We don't have any restriction under the domain configuration of Org Setting.
Any guidance or assistance in resolving this issue would be greatly appreciated.
#DigitalChannels
------------------------------
Syed Noman Hassan
------------------------------