From Bright Pattern Documentation
• 5.19
transfer
Make a transfer of one interaction to a consult call.
Request
Syntax
transfer(customTransferData?: CustomTransferData, mainCallId?: string, consultCallId?: string): Promise<OperationResult<null>> |
Where:
type CustomTransferData = Record<string, string | number | boolean | undefined | null> |
Parameters
Parameter | Parameter Values | Data Type | Optional/Required | Description |
customTransferData | String | Optional | You can define here any custom data to be transferred with interaction to the receiving party. | |
mainCallId | String | Optional | The ID of the interaction that you want to transfer. If not specified, the active interaction will be used. | |
consultCallId | String | Optional | The ID of a consult call interaction to which you want to transfer. If not specified, a consult call associated with the active interaction will be used. |
Example Request
transferButton.onclick = () => {
const mainItemId = mainItemIdInput.value
const consultCallId = consultCallIdInput.value
let transferData: any | null = null
try {
transferData = JSON.parse(transferDataTextarea.value)
} catch (e) {
alert('You have syntax error in the transfer data structure. Cannot parse JSON.')
}
adApi.transfer(transferData, mainItemId, consultCallId)
}
Return Value
null