Transfer A Conversation To An Agent REST API

Method

Make sure with the account manager that Ac Feature Flag is enabled for your brand: 'Messaging.Transfer_To_Agent'

Method URL
PUT https://{domain}//v1/transferToAgent/account/{accountId}/conversation/{conversationId}?agentId={agentId}&skillId={skillId}&fallBackSkillId={fallBackSkillId}

Headers

Name Value Example
Authorization Bearer 9014c8e3e4a3f8022f544774e8f43deccd9ecf30509cc1825

Path Params

Name Value Example
accountId 63358097
conversationId 3ba8451d-2722-4181-b4db-532c76b8f037

Query Params

Name Required
agentId Yes
skillId Optional
fallBackSkillId Optional

Use Case 1 : Selected Agent is Available

Use Case 1 : Selected Agent is Available ( ONLINE, CONNECTED, With available Capacity )

{skillId} query param Action Taken By API
Provided In case {skillId} is mentioned in the API query params, and the agent is available, Conversation will change its skill to skillId ( if provided ) and will be transferred to the suggested agent. ( Only if the suggested agent does not have the skillId assigned to him ). {fallBackSkillId} ( if provided ) will be ignored and not used.
Not Provided In case {skillId} is NOT mentioned in the API query params, and the agent is available, Conversation original skill will be retained and will be transferred to the suggested agent. ( Only if the suggested agent does not have the original assigned to him ). {fallBackSkillId} ( if provided ) will be ignored and not used.

Use Case 2 : Selected Agent NOT Available & fallback settings is true

Use Case 2 : Selected Agent NOT Available And also :

site settings for brand 'messaging.fall.to.requested.skill.if.suggested.agent.is.not.available' ( site settings ) = TRUE

{skillId} {fallBackSkillId} Action Taken By API
Provided Provided In case both {skillId} and {fallBackSkillId} are mentioned in the API query params, and the agent is not available, Suggested agent will be removed and conversation skill will be changed to {fallBackSkillId} Immediately. {skillId} will be ignored
Not Provided Provided In {skillId} is provided and {fallBackSkillId} ins not in the API query params, and the agent is not available, Suggested agent will be removed and conversation skill will be changed to {fallBackSkillId} Immediately. {skillId} will be ignored
Provided Not Provided In case {skillId} is provided and {fallBackSkillId} is not in the API query params, and the agent is not available, Suggested agent will be removed and conversation skill will be changed to {skillId} Immediately.
Not Provided Not Provided In case both {skillId} and {fallBackSkillId} are not in the API query params, and the agent is not available, Suggested agent will be removed Immediately and conversation skill will remain the same .

Use Case 3 : Selected Agent Is NOT Available & fallback settings is false

Use Case 3 : Selected Agent Is NOT Available And also :

site settings for brand 'messaging.fall.to.requested.skill.if.suggested.agent.is.not.available' ( site settings ) = FALSE

{skillId} {fallBackSkillId} Action Taken By API
Provided Provided In case both {skillId} and {fallBackSkillId} are mentioned in the API query params, and the agent is not available, Suggested agent will be removed and conversation skill will be changed to {fallBackSkillId} after 'messaging.transfer.max.wait.in.queue.time.seconds'. {skillId} will be ignored.
Not Provided Provided In case both {skillId} and {fallBackSkillId} are mentioned in the API query params, and the agent is not available, Suggested agent will be removed and conversation skill will be changed to {fallBackSkillId} after 'messaging.transfer.max.wait.in.queue.time.seconds'. {skillId} will be ignored.
Provided Not Provided In case {skillId} is provided and {fallBackSkillId} is not in the API query params, and the agent is not available, Suggested agent will be removed and conversation skill will be changed to {skillId} after 'messaging.transfer.max.wait.in.queue.time.seconds'.
Not Provided Not Provided In case both {skillId} and {fallBackSkillId} are not in the API query params, and the agent is not available, Suggested agent will be removed and conversation skill will be changed to the original skill of the conversation after 'messaging.transfer.max.wait.in.queue.time.seconds'.

Use Case 4 : 'fall.back.to.requested.skill.on.back.to.queue' ( site settings ) = FALSE

  1. When a ring is ringing to the suggested agent ( after the API call to the transfer ) and the agent is not accepting the ring. After the ring expires, the conversation will fallback to the requested {fallBackSkillId} skill that was provided in the API.
  2. When a ring is ringing to the suggested agent ( after the API call to the transfer ) and the ring was rejected ( could be due to a sudden change in the agent state or disconnected web socket while the ring is ringing ) the conversation will fallback to the requested {fallBackSkillId} that was provided in the API.
  3. After the suggested agent accepted the conversation, if it decides to return the conversation to queue, then the conversation will be fallback to the requested {fallBackSkillId}.

Response Codes

Code Response
202 Accepted — Will be executed Asynchronously
400 Bad request — Problem with query parameters
401 Unauthorized — Bad Authentication
403 Forbidden — Bad Authorization (invalid permissions)
429 Rate Limit - Too many requests
500 Internal Server Error — Please try again after the time specified in the response has passed

Response Body For 400/401/403/429/500

This is an example response body for errors :

   {
    "exceptionType": "MissingServletRequestParameterException",
    "message": "Required Long parameter 'agentId' is not present"
   }