I’m trying to integrate outbound calling capability into our custom agent desktop extension using the Embeddable Client App SDK. The requirement is to initiate a call via the Personal Connection API so the agent can dial from their softphone directly.
I have successfully obtained the OAuth token and verified it works for other endpoints like /api/v2/users/me. However, when I make the POST request to /api/v2/outbound/campaigns/{campaignId}/connections, I keep hitting a 400 Bad Request error.
Here is the JavaScript snippet I’m using for the request:
const response = await fetch(`https://api.cengage.com/api/v2/outbound/campaigns/${campaignId}/connections`, {
method: 'POST',
headers: {
'Authorization': `Bearer ${authToken}`,
'Content-Type': 'application/json',
'X-Genesys-Platform-Application-Name': 'CustomAgentDesktop'
},
body: JSON.stringify({
"contactListId": "8472910-8472-4920-8472-108472910847",
"contactId": "938472910-8472-4920-8472-108472910847",
"connectionType": "voice",
"skipTo": "playGreeting",
"attempt": 1,
"maxAttempts": 3,
"retryInterval": 5
})
});
The error response body is pretty vague:
{
"message": "Invalid request body",
"code": "invalid_request"
}
I’ve double-checked the contactListId and contactId in the CXone UI, and they definitely exist. The campaign is set to “Manual” mode. I’m wondering if there’s a specific field I’m missing or if the skipTo parameter is causing issues. The documentation for the Personal Connection API is a bit sparse on exact payload requirements for manual triggers.
Has anyone successfully triggered an outbound call this way? Any insights on what might be wrong with this payload structure would be appreciated. I’m stuck on this one.