Original Message:
Sent: 04-15-2025 12:17
From: Ranjith Manikante Sai
Subject: MessagingService.startConversation does not trigger backend POST in headlessMode=true
Hi @Syed Noman Hassan,
From your config posted here, I'm not able to see the content of `messenger.apps` object to see if auto starting the conversation is enabled. Either way, I will try answering both cases.
In general, `MessagingService.startConversation` command cannot be used when you are using `MessagingService.configureConversation` command because both do the same thing except when autoStart is enabled. How it differs, is discussed in the documentation here. In your case, when did configureConversation, the connection is already established and session is active. So, running MessagingService.startConversation command will simply be rejected because session is already active.
At this stage:
- When autoStart is not enabled in your configuration, you can start using `MessagingService.sendMessage` command to send messages - docs here. Note that, this is not a POST request but messages are sent with in the existing WebSocket connection that is made when doing configureConversation.
- When autoStart is enabled, you must use `MessagingService.joinConversation` command as discussed here and then start sending messages after it is has started.
Let us know if this helps.
Thanks,
Ranjith Sai
------------------------------
Ranjith Manikante Sai
Senior Manager, Development
Original Message:
Sent: 04-13-2025 18:46
From: Syed Noman Hassan
Subject: MessagingService.startConversation does not trigger backend POST in headlessMode=true
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
------------------------------