Jump to: navigation, search

CompleteTransfer

This operation is part of the Voice API section of the Web Services API.

Overview

Completes a previously initiated two-step transfer.

Request URL /api/v2/me/calls/{id}
HTTP method POST
Required features api-voice

Parameters

Parameter Value
operationName CompleteTransfer
consultCallUri You can use this optional parameter to specify the consult call that should be used to complete the transfer. If not provided, Web Services determines the related call.

Sample 1

Request

POST api/v2/me/calls/01RCC3N118B1V0SL8O7GK2LAES00000N
{
  "operationName": "CompleteTransfer"
}

HTTP response

{
  "statusCode": 0
}

CometD notification

After completing the transfer the agent receives notification that the original call is released:

{  
   "data":{  
      "notificationType":"StatusChange",
      "call":{  
         "id":"01RCC3N118B1V0SL8O7GK2LAES00000M",
         "state":"Released",
         "callUuid":"01RCC3N118B1V0SL8O7GK2LAES00000M",
         "connId":"0071027198180016",
         "deviceUri":"http://127.0.0.1:8080/api/v2/devices/631608b3-ceb1-472b-ba05-2ae39555b0d1",
         "participants":[  
            {  
               "e164Number":"",
               "formattedPhoneNumber":"15001",
               "phoneNumber":"15001",
               "digits":"15001"
            }
         ],
         "dnis":"15001",
         "callType":"Internal",
         "capabilities":[  

         ],
         "duration":"280",
         "mute":"Off",
         "supervisorListeningIn":false,
         "monitoredUserMuted":false,
         "monitoring":false,
         "uri":"http://127.0.0.1:8080/api/v2/me/calls/01RCC3N118B1V0SL8O7GK2LAES00000M",
         "path":"/calls/01RCC3N118B1V0SL8O7GK2LAES00000M"
      },
      "phoneNumber":"15000",
      "extensions":{  
         "BusinessCall":0
      },
      "messageType":"CallStateChangeMessage"
   },
   "channel":"/v2/me/calls"
}

and that the consult call is released as well:

{  
   "data":{  
      "notificationType":"StatusChange",
      "call":{  
         "id":"01RCC3N118B1V0SL8O7GK2LAES00000N",
         "state":"Released",
         "callUuid":"01RCC3N118B1V0SL8O7GK2LAES00000N",
         "connId":"0071027198180017",
         "deviceUri":"http://127.0.0.1:8080/api/v2/devices/631608b3-ceb1-472b-ba05-2ae39555b0d1",
         "participants":[  
            {  
               "e164Number":"",
               "formattedPhoneNumber":"15002",
               "phoneNumber":"15002",
               "digits":"15002"
            }
         ],
         "dnis":"15002",
         "callType":"Consult",
         "capabilities":[  

         ],
         "duration":"237",
         "mute":"Off",
         "supervisorListeningIn":false,
         "monitoredUserMuted":false,
         "monitoring":false,
         "uri":"http://127.0.0.1:8080/api/v2/me/calls/01RCC3N118B1V0SL8O7GK2LAES00000N",
         "path":"/calls/01RCC3N118B1V0SL8O7GK2LAES00000N"
      },
      "phoneNumber":"15000",
      "extensions":{  
         "BusinessCall":0
      },
      "messageType":"CallStateChangeMessage"
   },
   "channel":"/v2/me/calls"
}

Sample 2

The following examples describe a full two-step transfer scenario from start to finish.

First, the agent receives a notification of the inbound call:

{  
   "data":{  
      "notificationType":"StatusChange",
      "call":{  
         "id":"011DJV5JI898NB2L04000VTAES000005",
         "state":"Ringing",
         "callUuid":"011DJV5JI898NB2L04000VTAES000005",
         "connId":"007102385535e005",
         "deviceUri":"http://127.0.0.1:8080/api/v2/devices/efe1ab32-53f9-43ce-b65e-5768c61f7d4a",
         "participants":[  
            {  
               "e164Number":"",
               "formattedPhoneNumber":"5000",
               "phoneNumber":"5000",
               "digits":"5000"
            }
         ],
         "dnis":"5005",
         "callType":"Internal",
         "capabilities":[  
            "UpdateUserData",
            "DeleteUserData",
            "AttachUserData",
            "DeleteUserDataPair",
            "Answer"
         ],
         "duration":"0",
         "mute":"Off",
         "supervisorListeningIn":false,
         "monitoredUserMuted":false,
         "uri":"http://127.0.0.1:8080/api/v2/me/calls/011DJV5JI898NB2L04000VTAES000005",
         "path":"/calls/011DJV5JI898NB2L04000VTAES000005"
      },
      "phoneNumber":"5005",
      "extensions":{  
         "WrapUpTime":0,
         "BusinessCall":0
      },
      "messageType":"CallStateChangeMessage"
   },
   "channel":"/v2/me/calls"
}

The agent sends a request to answer the call:

POST api/v2/me/calls/011DJV5JI898NB2L04000VTAES000005
{
  "operationName": "Answer"
}

The agent receives a notification that the call has been established:

{  
   "data":{  
      "notificationType":"StatusChange",
      "call":{  
         "id":"011DJV5JI898NB2L04000VTAES000005",
         "state":"Established",
         "callUuid":"011DJV5JI898NB2L04000VTAES000005",
         "connId":"007102385535e005",
         "deviceUri":"http://127.0.0.1:8080/api/v2/devices/efe1ab32-53f9-43ce-b65e-5768c61f7d4a",
         "participants":[  
            {  
               "e164Number":"",
               "formattedPhoneNumber":"5000",
               "phoneNumber":"5000",
               "digits":"5000"
            }
         ],
         "dnis":"5005",
         "callType":"Internal",
         "capabilities":[  
            "UpdateUserData",
            "SingleStepConference",
            "DeleteUserData",
            "Hangup",
            "SendDtmf",
            "Hold",
            "AttachUserData",
            "SingleStepTransfer",
            "InitiateConference",
            "DeleteUserDataPair",
            "InitiateTransfer"
         ],
         "duration":"10",
         "mute":"Off",
         "supervisorListeningIn":false,
         "monitoredUserMuted":false,
         "uri":"http://127.0.0.1:8080/api/v2/me/calls/011DJV5JI898NB2L04000VTAES000005",
         "path":"/calls/011DJV5JI898NB2L04000VTAES000005"
      },
      "phoneNumber":"5005",
      "extensions":{  
         "WrapUpTime":0,
         "BusinessCall":0
      },
      "messageType":"CallStateChangeMessage"
   },
   "channel":"/v2/me/calls"
}

The agent initiates the two-step transfer:

POST api/v2/me/calls/011DJV5JI898NB2L04000VTAES000005
{
  "operationName": "InitiateTransfer",
  "destination": {
    "phoneNumber": "5001"
  }
}

The agent receives notification that the first call has been held:

{  
   "data":{  
      "notificationType":"StatusChange",
      "call":{  
         "id":"011DJV5JI898NB2L04000VTAES000005",
         "state":"Held",
         "callUuid":"011DJV5JI898NB2L04000VTAES000005",
         "connId":"007102385535e005",
         "deviceUri":"http://127.0.0.1:8080/api/v2/devices/efe1ab32-53f9-43ce-b65e-5768c61f7d4a",
         "participants":[  
            {  
               "e164Number":"",
               "formattedPhoneNumber":"5000",
               "phoneNumber":"5000",
               "digits":"5000"
            }
         ],
         "dnis":"5005",
         "callType":"Internal",
         "capabilities":[  
            "UpdateUserData",
            "SingleStepConference",
            "DeleteUserData",
            "Hangup",
            "Retrieve",
            "AttachUserData",
            "SingleStepTransfer",
            "InitiateConference",
            "DeleteUserDataPair",
            "InitiateTransfer"
         ],
         "duration":"36",
         "mute":"Off",
         "supervisorListeningIn":false,
         "monitoredUserMuted":false,
         "uri":"http://127.0.0.1:8080/api/v2/me/calls/011DJV5JI898NB2L04000VTAES000005",
         "path":"/calls/011DJV5JI898NB2L04000VTAES000005"
      },
      "phoneNumber":"5005",
      "extensions":{  
         "WrapUpTime":0,
         "BusinessCall":0
      },
      "messageType":"CallStateChangeMessage"
   },
   "channel":"/v2/me/calls"
}

and that the consult call is now dialing:

{  
   "data":{  
      "notificationType":"StatusChange",
      "call":{  
         "id":"011DJV5JI898NB2L04000VTAES000006",
         "state":"Dialing",
         "callUuid":"011DJV5JI898NB2L04000VTAES000006",
         "connId":"007102385535e006",
         "deviceUri":"http://127.0.0.1:8080/api/v2/devices/efe1ab32-53f9-43ce-b65e-5768c61f7d4a",
         "participants":[  
            {  
               "e164Number":"",
               "formattedPhoneNumber":"5001",
               "phoneNumber":"5001",
               "digits":"5001"
            }
         ],
         "dnis":"5001",
         "callType":"Consult",
         "capabilities":[  
            "UpdateUserData",
            "DeleteUserData",
            "Hangup",
            "SwapCalls",
            "CompleteTransfer",
            "SendDtmf",
            "AttachUserData",
            "DeleteUserDataPair"
         ],
         "parentCallUri":"http://127.0.0.1:8080/api/v2/me/calls/011DJV5JI898NB2L04000VTAES000005",
         "duration":"0",
         "mute":"Off",
         "supervisorListeningIn":false,
         "monitoredUserMuted":false,
         "uri":"http://127.0.0.1:8080/api/v2/me/calls/011DJV5JI898NB2L04000VTAES000006",
         "path":"/calls/011DJV5JI898NB2L04000VTAES000006"
      },
      "phoneNumber":"5005",
      "extensions":{  
         "WrapUpTime":0,
         "BusinessCall":0
      },
      "messageType":"CallStateChangeMessage"
   },
   "channel":"/v2/me/calls"
}

To complete, the agent requests completion of the transfer:

POST api/v2/me/calls/011DJV5JI898NB2L04000VTAES000006
{
  "operationName": "CompleteTransfer"
}

The agent then receives notification that original call has been released:

{  
   "data":{  
      "notificationType":"StatusChange",
      "call":{  
         "id":"011DJV5JI898NB2L04000VTAES000005",
         "state":"Released",
         "callUuid":"011DJV5JI898NB2L04000VTAES000005",
         "connId":"007102385535e005",
         "deviceUri":"http://127.0.0.1:8080/api/v2/devices/efe1ab32-53f9-43ce-b65e-5768c61f7d4a",
         "participants":[  
            {  
               "e164Number":"",
               "formattedPhoneNumber":"5000",
               "phoneNumber":"5000",
               "digits":"5000"
            }
         ],
         "dnis":"5005",
         "callType":"Internal",
         "capabilities":[  

         ],
         "duration":"48",
         "mute":"Off",
         "supervisorListeningIn":false,
         "monitoredUserMuted":false,
         "uri":"http://127.0.0.1:8080/api/v2/me/calls/011DJV5JI898NB2L04000VTAES000005",
         "path":"/calls/011DJV5JI898NB2L04000VTAES000005"
      },
      "phoneNumber":"5005",
      "extensions":{  
         "WrapUpTime":0,
         "BusinessCall":0
      },
      "messageType":"CallStateChangeMessage"
   },
   "channel":"/v2/me/calls"
}

and the consult call has been released:

{  
   "data":{  
      "notificationType":"StatusChange",
      "call":{  
         "id":"011DJV5JI898NB2L04000VTAES000006",
         "state":"Released",
         "callUuid":"011DJV5JI898NB2L04000VTAES000006",
         "connId":"007102385535e006",
         "deviceUri":"http://127.0.0.1:8080/api/v2/devices/efe1ab32-53f9-43ce-b65e-5768c61f7d4a",
         "participants":[  
            {  
               "e164Number":"",
               "formattedPhoneNumber":"5001",
               "phoneNumber":"5001",
               "digits":"5001"
            }
         ],
         "dnis":"5001",
         "callType":"Consult",
         "capabilities":[  

         ],
         "parentCallUri":"http://127.0.0.1:8080/api/v2/me/calls/011DJV5JI898NB2L04000VTAES000005",
         "duration":"12",
         "mute":"Off",
         "supervisorListeningIn":false,
         "monitoredUserMuted":false,
         "uri":"http://127.0.0.1:8080/api/v2/me/calls/011DJV5JI898NB2L04000VTAES000006",
         "path":"/calls/011DJV5JI898NB2L04000VTAES000006"
      },
      "phoneNumber":"5005",
      "extensions":{  
         "WrapUpTime":0,
         "BusinessCall":0
      },
      "messageType":"CallStateChangeMessage"
   },
   "channel":"/v2/me/calls"
}
This page was last edited on October 31, 2023, at 13:28.
Comments or questions about this documentation? Contact us for support!