InitiateTransfer
This operation is part of the Voice API section of the Web Services API.
Overview
Initiates a two-step transfer to the specified destination. After initiating the transfer, you can use the CompleteTransfer operation to complete the transfer.
Request URL | /api/v2/me/calls/{id} |
---|---|
HTTP method | POST |
Required features | api-voice |
Parameters
Parameter | Value |
---|---|
operationName | InitiateTransfer |
destination | A JSON object that includes the number to be dialed. |
location | An optional parameter that is used by Web Services to set the location attribute for the corresponding T-Server requests. |
userData | An optional JSON object that includes key/value data to be included with the call. |
Sample 1
Request
POST api/v2/me/calls/01RCC3N118B1V0SL8O7GK2LAES00000M
{
"operationName": "InitiateTransfer",
"destination": {
"phoneNumber": "15002"
}
}
HTTP response
{
"statusCode": 0
}
CometD notification
The first notification is that the original call has been placed on hold:
{
"data":{
"notificationType":"StatusChange",
"call":{
"id":"01RCC3N118B1V0SL8O7GK2LAES00000M",
"state":"Held",
"callUuid":"01RCC3N118B1V0SL8O7GK2LAES00000M",
"connId":"0071027198180011",
"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":[
"UpdateUserData",
"SwapCalls",
"InitiateConference",
"SingleStepTransfer",
"InitiateTransfer",
"AttachUserData",
"DeleteUserDataPair",
"SingleStepConference",
"DeleteUserData",
"Hangup",
"CompleteTransfer"
],
"duration":"99",
"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",
"messageType":"CallStateChangeMessage"
},
"channel":"/v2/me/calls"
}
The second notification is of the new consult call dialing:
{
"data":{
"notificationType":"StatusChange",
"call":{
"id":"01RCC3N118B1V0SL8O7GK2LAES00000N",
"state":"Dialing",
"callUuid":"01RCC3N118B1V0SL8O7GK2LAES00000N",
"connId":"0071027198180013",
"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":[
"UpdateUserData",
"SendDtmf",
"SwapCalls",
"AttachUserData",
"DeleteUserDataPair",
"DeleteUserData",
"Hangup",
"CompleteTransfer"
],
"parentCallUri":"http://127.0.0.1:8080/api/v2/me/calls/01RCC3N118B1V0SL8O7GK2LAES00000M",
"duration":"0",
"mute":"Off",
"supervisorListeningIn":false,
"monitoredUserMuted":false,
"monitoring":false,
"uri":"http://127.0.0.1:8080/api/v2/me/calls/01RCC3N118B1V0SL8O7GK2LAES00000N",
"path":"/calls/01RCC3N118B1V0SL8O7GK2LAES00000N",
"parentCallPath":"/calls/01RCC3N118B1V0SL8O7GK2LAES00000H"
},
"phoneNumber":"15000",
"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"
}