Custom Requests
Scope
This page helps you to start using the Integration API functionality in order to send requests to the b+s Connects, by providing examples and ideas.
For more information please refer to the documentation of the Integration API.
Limitations
For web clients the Integration API supports requests to b+s Connects only. The subscription to events is not supported.
Dispatch a Request
To send a request to the b+s Connects gadget a custom event of type integrationapi
needs to be dispatched to the top window.
window.top.dispatchEvent( new CustomEvent('integrationapi', {detail: { [DATA] }} ))
[DATA]
needs to be replaced by the parameters outlined in the Integration API documentation.
In single session environments CIClickToAct
can be used instead of integrationapi
. But it is not recommended in multi session environments, because the requests could be blocked by Microsoft Dynamics.
Examples
Create a new session
A description of the request can be found here.
window.top.dispatchEvent(
new CustomEvent('integrationapi', {
detail: {
request: 'createSession',
templateName: 'cnx_integration_api'
}
})
);
Set agent state to NOT_READY
A description of the request can be found here.
window.top.dispatchEvent(
new CustomEvent('integrationapi', {
detail: {
request: 'setAgentState',
channelId: 'telephony',
state: 'NotReady',
reasonCode: '86d19e27-1af2-4621-bc33-fe94f5dfb227'
}
})
);
Start an outbound call
window.top.dispatchEvent(
new CustomEvent('integrationapi', {
detail: {
value: '123456',
entityLogicalName: 'contact',
entityId: '84238a06-14f7-eb11-94ee-0022489'
}
})
);
Write a log message
window.top.dispatchEvent(
new CustomEvent('integrationapi', {
detail: {
request: 'writeLog',
logMessage: 'Example debug message',
logLevel: 'Debug'
}
})
);