addInteractionAssociatedObject
Sends to the Agent Desktop application the selected options(s) from the associated activity history object that the agent wants to link with the specified interaction. Agents will be able to select the associated object(s) in the Agent Desktop Communicator Widget v2 user interface, and the result will be sent in the data for the onInteractionRemoved callback.
Request
Syntax
addInteractionAssociatedObject(object: InteractionAssociatedObject, interactionId?: string): Promise<OperationResult<null>> |
Where:
type InteractionAssociatedObject = {
id: string type: string displayName: string displayType: string customFields: Record<string, string> } |
Parameters
Parameter | Parameter Values | Data Type | Optional/Required | Description |
object | ||||
id | String | Required | The object’s unique ID | |
type | String | Required | The type of object (e.g., contact, case, task, etc.) | |
displayName | String | Required | The object’s display name | |
displayType | String | Required | The object’s display type | |
customFields | Record<string, string> | Optional | Any additional information that you want to provide about the object | |
interactionId | String | Optional | The ID of the interaction you want to set as active |
Example Request
addInteractionAssociatedObjectButton.onclick = () => {
let associatedObject: InteractionAssociatedObject | null = null
try {
associatedObject = JSON.parse(activeAssociatedObjectTextarea.value)
} catch (e) {
alert('You have syntax error in the associated object structure. Cannot parse JSON.')
}
if (!associatedObject) {
return
}
const itemId = activeAssociatedInteractionIdInput.value
adApi.addInteractionAssociatedObject(associatedObject, itemId)
}
Return Value
null