Call Log Pull API

GET Method

Kaleyra.io lets you access the call log of your Kaleyra account via the UI (Channel>Voice>Logs screen). Logs screen displays information like the type of call, from and to numbers, call start time, bridge number, call status, duration of the call, and the credits utilized for the call.

The same can be achieved using the Call Log Pull API. Kaleyra.io offers the Call Log Pull API to access the call log details of your Kaleyra account for a period of 7 days using parameters like start time, end time, status, and so on.

👍

Base URL

"https://api.kaleyra.io/v1/"

1. Signup or Login to Kaleyra.io and create your API key

Refer to the Create an API Key page for steps to create your API key.

📘

Note:

After you sign up, your account will be on the trial version. You must complete the KYC to access all the features in Kaleyra.io.After you sign up, your account will be on the trial version. You must complete the KYC to access all the features in Kaleyra.io.

2. API request to access the call log details

Request Format

To get the call log, use the following voice/call-logs endpoint.

curl -X POST 'https://api.kaleyra.io/v1/<SID>/voice/call-logs' \
-H 'Content-Type: <CONTENT_TYPE>' \
-H "api-key: <API_KEY>" \
-H 'limit: <LIMIT>' \
-d 'status=<STATUS>' \
-d 'call_id=<CALL_ID>' \
-d 'start_time=<START_TIME>' \
-d 'end_time=<END_TIME>' \
-d 'page=<PAGE>' \
-d 'offset=<OFFSET>' \
-d 'bridge=<BRIDGE>'

Provide the details listed in the Parameters and Variable section.

Parameters and Descriptions

Following is the list of parameters and variables supported:

Parameter

Data Type

Description

Example

Mandatory?

SID

String

Account SID (Security Identifier). Generated by Kaleyra.io while creating an API key.

HXEPXXXXXX1US

True

CONTENT_TYPE

String

Indicates the format of the content the API will be processing.

application/x-www-form-urlencoded

True

API_KEY

Alphanumeric

API key generated from Kaleyra.io account

Axxxxxxxxxxxxxxxxxxxxxxxxxxxx3

True

Limit

Integer

Limit of records to be listed/fetched for each API call, default is 25.

25

False

Status

String

Status of the call. In the case of multiple call statuses, ensure they are comma-separated.

ANSWER
or
NOANSWER

False

Call_id

String

Valid call ID. In case of multiple call IDs, ensure they are comma-separated.

75xxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx-x

False

Start_time

Date and Time

Start time for the call log.

Note that you can pull logs for up to seven days including the current day.

The format is [2013-03-15T00:00:00+00:00 (Format: Y-m-d\TH:i:sP)]

Default is current time in 24 hr format.

2020-07-28T10:16:25Z,2020-08-12T15:16:25Z

False

End_time

Date and Time

End time for the call log.

Note that you can pull logs for up to seven days including the current day.

The format is [2013-03-15T00:00:00+00:00 (Format: Y-m-d\TH:i:sP)]

Default is current time in 24 hr format.

2020-07-29T10:16:25Z,2020-08-12T15:16:25Z

False

Page

Integer

Total number of pages that you want to access.

4

False

Offset

Integer

Number of records that should be skipped while displaying data on the second page onwards.

20

False

Bridge

Integer

The DID number to be used for originating the call, should be an Active subscribed number.
The number must contain the format as Country Code followed by Mobile Number.

13236xxxxx7

False

Sample Success Response

Call Log Pull success response

{
    "status": 200,
    "code": "RBC103",
    "message": "Request successfully executed!",
    "data": [],
    "error": {},
    "total": 0,
    "offset": 0,
    "limit": 25,
    "page": 1
}

Sample Failure Response

Call Log Pull failure response with an invalid SID or API key
If your response fails due to the invalid SID or API key, re-execute the command with a valid SID or API key.

{
    "code": "RBC001",
    "message": "Incorrect SID or API key.",
    "data": [],
    "error": {
        "error": "Incorrect SID or API key."
    }
}

Call Log Pull failure response when incorrect start time is provided
If your response fails due to the invalid values, re-execute the command with valid values.

{
    "code": "RBC3004",
    "message": "Incorrect start time.",
    "data": [],
    "error": {
        "error": "Incorrect start time."
    }
}

HTTP Status Code

The below table provides information about the HTTP status code you would receive when executing the outbound calling API.

HTTP Status

Description

200

Request successfully executed.

400

Invalid Inputs, Validation Error

500

Internal server error message


Did this page help you?