With the Transfer Call API it is possible to transfer calls. For example, a call can first be forwarded to a call center, and then transferred to a specialist if required.
Initiate Transfer call:
This method is used to transfer a call. For a call to be transferred, it must already be forwarded to a destination and connected.
POST |
https://api.tenios.com/transfer-call |
Request parameter:
access_key |
The access key for the API. This can be found in the customer portal under the menu item MY ACCOUNT/ General Settings in the API section. |
call_uuid |
The UUID of the call to be transferred. |
destinationn_type |
The type of destination to which the call should be transferred. The possible values are
- EXTERNALNUMBER – For transfer to a number in the PSTN.
- SIP_USER – For transfer to a SIP account.
- SIP_TRUNK – For transfer to a SIP trunk.
|
destination |
The destination, depending on the destination_type.
- EXTERNALNUMBER – A phone number in international format (E.164), with leading plus sign, e.g. +492215540030.
- SIP_USER – The user name of the SIP account.
- SIP_TRUNK – The user name of the SIP trunk.
|
Response parameter:
success boolean |
true if successful, otherwise an error message. |
Example of a successful request:
Request:
{
"access_key": "XXXXX-XXXX-XXXXXX",
"call_uuid": "XXXXX-XXXX-XXXXXX",
"destination_type": "EXTERNALNUMBER",
"destination": "+4922155400300"
}
API Response:
HTTP Status Code: 200 (OK)
{
"success": true
}
Examples of incorrect requests:
INVALID_FIELD_1
This error is returned if an invalid input was specified at the sip_uri parameter.
Request:
{
"access_key": "XXXXX-XXXX-XXXXXX",
"call_uuid": "XXXXX-XXXX-XXXXXX",
"destination_type": "EXTERNAL",
"destination": "+4922155400300"
}
API Response:
HTTP Status Code: 400 (Bad Request)
{
"success": false,
"error_code": "INVALID_VALUE",
"error_message": "Invalid parameter type or format",
"fields": [
"destination_type"
]
} }
INVALID_FILED_2
This error is returned if an incorrect or invalid input was given to the call_uuid parameter.
Request:
{
"access_key": "XXXXX-XXXX-XXXXXX",
"call_uuid": "123456789",
"sip_uri": "sip:4044@8.8.8.8:5060;user=phone"
}
API Response:
HTTP Status Code: 400 (Bad Request)
{
"error_code": "INVALID_FIELD",
"error_message": "Invalid 'call_uuid' input parameter. Invalid value - '1234567890'.",
"fields": [
"call_uuid"
]
}
INVALID_JSON
This error is returned if a parameter is missing.
Request:
{
"access_key": "XXXXX-XXXX-XXXXXX",
"call_uuid": "XXXXX-XXXX-XXXXXX"
}
API Response:
HTTP Status Code: 400 (Bad Request)
{
"error_code": "INVALID_JSON",
"error_message": "An invalid JSON object was provided in the request body.",
"fields": []
}
CALL_UUID_NOT_FOUND
This error is returned if the uuid of the call was not found.
Request:
{
"access_key": "XXXXX-XXXX-XXXXXX",
"call_uuid": "c0b93a5e-4ce0-4adb-940e-5079f2abbcb4",
"destination_type": "EXTERNALNUMBER",
"destination": "+4922155400300"
}
API Response:
HTTP Status Code: 400 (Bad Request)
{
"success": false,
"error_code": "CALL_UUID_NOT_FOUND",
"error_message": "The call wasn't found",
"fields": [
"call_uuid"
]
}