Callback API

The Callback API allows to integrate callback functionality to your project. It has following URLs:

Initialize a callback:

A method to initialize a callback. Uses the HTTP-POST method.

POST https://api.tenios.com/callback/init

 

Request Parameter:

access_key
String
Obligatorisch
The api access key. It can be found in the menu item General Settings, section API in the customer portal.
callback_config_id
String
Obligatorisch
The callback config id. You find it at the Callback Configurations page of the TENIOS portal.
callback_number
String
Obligatorisch
This is the phone number which should receive a call.
delay
String
Obligatorisch
Delay (seconds) before calling.

Example for a successful request:

Request:

{
    "access_key" : "XXXXX-XXXX-XXXXXX",
    "callback_config_id" : "XXXXX-XXXX-XXXXXX",
    "callback_number" : "+491234567890",
    "delay" : 30
}

 API Response:

 HTTP Status Code: 200 (OK)

{
    "id" : 10
}

 

Example for invalid requests:

 

BAD_CREDENTIALS_1
This code is returned when an invalid access_key was provided.

Request:

{
    "access_key" : "XXXXX-XXXX-XXXXXX",
    "callback_config_id" : "XXXXX-XXXX-XXXXXX",
    "callback_number" : "+491234567890",
    "delay" : 30
}

API Response:

HTTP Status Code: 400 (Bad Request)

{
    "error_code": "BAD_CREDENTIALS",
    "error_message": "Bad credentials",
    "fields": []
}

 

BAD_CREDENTIALS_2
This code is returned when callback_config_id was provided.

Request:

{
    "access_key" : "XXXXX-XXXX-XXXXXX",
    "callback_config_id" : "xxx-xxx-xxx",
    "callback_number" : "+491234567890",
    "delay" : 30
}

API Response:

HTTP Status Code: 400 (Bad Request)

{
    "error_code": "BAD_CREDENTIALS",
    "error_message": "Bad credentials",
    "fields": []
}   

 

Status of an existing callback:

A method to query the status of an existing callback. Uses the HTTP-GET method.

POST https://api.tenios.com/callback/status

 

Request Parameter:

access_key
String
Obligatorisch
The api access key. It can be found in the menu item General Settings, section API in the customer portal.
id
String
Obligatorisch
The id of a callback request. This id was sent in the response body of the related init callback request

 

The callback request has following status:

REQUESTED Callback requested.
ACCEPTED Callback request accepted.
CALLING_A PartnerA is being called.
CALL_A_FAILED Call to partner A not successful.
CALLING_B Partner B is being called.
CALL_B_FAILED Call to partner B not successful.
CONNECTED Call connected (between partner A and B)
DISCONNECTED Call disconnected (after successful call between partner A and B)

Example of a successful request:

Request:

{
    "access_key" : "XXXXX-XXXX-XXXXXX"
    "id" : 10
}

API Response:

HTTP Status Code: 200 (OK)

{
   "status" : "REQUESTED"
}

Example of unsuccessful requests:

CALLBACK_NOT_FOUND
This code ist returned when the provided callback id access_key was provided.

Request:

{
    "access_key" : "XXXXX-XXXX-XXXXXX"
    "id" : "xxx"
}

API Response:

HTTP Status Code: 400 (Bad Request)

{
    "error_code" : "CALLBACK_NOT_FOUND",
    "error_message" : "Callback id not found",
    "fields": [
    "id"
  ]
}
TOP