This page contains usage and methods description of the API
Requests via API must be made with Token. Token availiable in the user’s personal area. You can pick it up by following the next steps:
Go to the user settings drop down menu.
Select the profile page and navigate to tab API token to generate it.
Enter the password for the user you logged in with and press Issue new token
Copy token and set it as Authorization header into HTTP request:
NOTE: Bearer REQUIRED WORD to be added before token itself
Authorization: Bearer YOUR_TOKEN
Requests with a body uses JSON format. The header
Content-type: application/json
is required
for it.
the service sends 5 types of the responses:
200 response with correct info. It always
contains Content-type: application/json
body
400 Bad request: if body of the request doesn’t contain expected fields
401 Unauthorized: if no token was not provided or expired
404 Not found: if requested resource is not available
5xx class, if our service temporary unavailiable
POST
/telephony/v1/calls/list
Limitatons:
Only 100 calls can be provided per request
Only not later than 30 days calls from the request time are availiable to fetch
Request Body:
array of <call>
where call is:
[
{
"callid": "According RFC3261: The Call-ID header field is a unique ID identifying the SIP call",
"time": "call start time in RFC3339 standart with timezone: as YYYY-MM-DDTHH:MM:SS±HH:MM"
}
]
Response Body:
The 200 response contains following fields:
{
"result": {
"status": "success/error",
"description": "describes error cause"
},
"data": [{
"callid":"SIP_CALLID",
"from":"Source Number",
"to":"Destination Number",
"cost": 0.000075, //EUR
"duration":5, //seconds
"setup_time":"YYYY-MM-DDTHH:MM:SS±HH:MM",
"start_time":"YYYY-MM-DDTHH:MM:SS±HH:MM",
"end_time":"YYYY-MM-DDTHH:MM:SS±HH:MM",
"cause_code_q931":16 // q931 standart reason code
}]
}
Examples
request:
curl -X POST https://api.rocketconnect.cc/telephony/v1/calls/list \
-H "Authorization: Bearer TOKEN" \
-H "Content-Type: application/json" \
-d '{"calls": [ {"callid": "ZxdwerwerfAWRWR", "time":"2023-11-23T09:02:37+00:00"} ]}'
response error:
{
"data":null,
"result":{
"status":"error",
"description":"Unable to find any calls according the filter"
}
}
response success:
{
"data": [{
"callid":"ZxdwerwerfAWRWR",
"from":"120290001999",
"to":"373033333333",
"cost":0.000175,
"duration":5,
"setup_time":"2023-11-23T09:02:37+00:00",
"start_time":"2023-11-23T09:02:38+00:00",
"end_time":"2023-11-23T09:02:43+00:00",
"cause_code_q931":16
}
],
"result": {
"status":"success",
"description":""
}
}
POST
/telephony/v1/calls/time
Provides calls sorted by time within requested time range. NOTE: There is a limit in 1000 calls retuned for now. If there are more calls withtin the range - take last time provided as next time_from and make a new request. Repeat it until get closest to time_to
Limitations - Only 1000 calls can be provided per request. - The requested time interval cannot exceed 30 days. - Timezones must be the same for time_from and time_to filter.
Request Body: - The request simply specifies the boundaries of the interval.
{
"time_from":"Lower limit in RFC3339 standard with timezone: as YYYY-MM-DDTHH:MM:SS±HH:MM",
"time_to":"Upper limit in RFC3339"
}
Response Body:
The 200 response contains following fields:
{
"result": {
"status": "success/error",
"description": "describes error cause"
},
"data": [{
"callid":"SIP_CALLID",
"from":"Source Number",
"to":"Destination Number",
"cost": 0.000075, //EUR
"duration":5, //seconds
"setup_time":"YYYY-MM-DDTHH:MM:SS±HH:MM",
"start_time":"YYYY-MM-DDTHH:MM:SS±HH:MM",
"end_time":"YYYY-MM-DDTHH:MM:SS±HH:MM",
"cause_code_q931":16 // q931 standart reason code
}]
}
Examples
request:
curl -X POST https://api.rocketconnect.cc/telephony/v1/calls/list \
-H "Authorization: Bearer TOKEN" \
-H "Content-Type: application/json" \
-d '{"time_from":"2023-11-23T09:02:37+00:00", "time_to":"2023-11-25T00:00:00+00:00"} ]}'
response error:
{
"data":null,
"result":{
"status":"error",
"description":"Unable to find any calls according the filter"
}
}
response success:
{
"data": [{
"callid":"ZxdwerwerfAWRWR",
"from":"120290001999",
"to":"373033333333",
"cost":0.000175,
"duration":5,
"setup_time":"2023-11-23T09:02:37+00:00",
"start_time":"2023-11-23T09:02:38+00:00",
"end_time":"2023-11-23T09:02:43+00:00",
"cause_code_q931":16
}
],
"result": {
"status":"success",
"description":""
}
}
GET
/telephony/v1/balance/current
Response Body:
The 200 response contains following fields:
{
"result": {
"status": "success/error",
"description": "describes error cause"
},
"data":{
"amount": 0.0,
"currency":"EUR"
}
}
Examples
request:
`curl https://api.rocketconnect.cc/telephony/v1/balance/current -H "Authorization: Bearer TOKEN"
response error:
{
"data":null,
"result":{
"status":"error",
"description":"Unable to retrieve balance"
}
}
response success:
{
"data":{
"amount":676.6878,
"currency":"EUR"
},
"result":{
"status":"success",
"description":""
}
}