Get URL Analytics Data
GET Method
The Get URL Analytics Data API GET request enables you to get analytics data (IP, Browser, Browser Version, and many more) for a shortened URL.
API Domain and Value
api_domain | Value |
---|---|
IN pod | api.in.kaleyra.io |
SG Pod | api.kaleyra.io |
EU Pod | api.eu.kaleyra.io |
NA pod | api.na.kaleyra.ai |
Request Format
To get the URL analytics data, use the following endpoint:
curl --location --request GET 'https://<api_domain>/v1/<sid>/url-shortner/logs/<ID>?page=<PAGE>' \
--header 'api-key: <API-KEY>'
Note:Ensure to replace the parameter values with the proper inputs in the above code.
Parameters and Variables
Following is the list of parameters and variables used:
Replace | Variable | Description | Example | Mandatory |
---|---|---|---|---|
| String | Base URL based on region. |
| True |
| String | Account SID (Security Identifier). | HXXXXXXX071IN | True |
| Number | URL shortener ID to get the associated URL shortener URL from the database. | 317 | True |
| Number | The number of pages in which you wish to view the logs. One page can have a maximum of 25 records. | 1 | False |
| Alphanumeric | API key generated from Kaleyra.io account. | Axxxxxxxxxxxxxxxxxxxxxxxxxxxx3 | True |
Response Format
This section provides you with the success and failure JSON response format for different scenarios. Refer to the below sections for more information:
Sample Success Response
Sample Failure Response
Sample Success Response
The following is a sample success response:
{
"code": "RBC103",
"message": "Request successfully executed!",
"data": [
{
"client_ip": "1xx.x.x.1",
"browser": "Chrome",
"browser_version": "92.0.4xx5.1x1",
"browser_lang": "[\"en-gb\",\"en-us\",\"en\"]",
"platform": "Windows",
"platform_version": false,
"device_type": "WebKit",
"country": "",
"city": null,
"created_at": "2022-03-03 18:53:57+05:30",
"mobile": "",
"clicked_time": "2022-03-03 18:55:08+05:30"
}
],
"error": {},
"limit": 25,
"offset": 0,
"total": 1
}
Sample Failure Response
The following is sample failure responses:
{
"code": "RBC168",
"message": "No Data Found",
"data": [],
"error": {}
}
{
"code": "RBC235",
"message": "Invalid id Property",
"data": [],
"error": {
"error": "Invalid id Property"
}
}
Sample Request
curl --location --request GET 'https://api.in.kaleyra.io/v1/HXXXXXXX071IN/url-shortner/logs/317?page=1' \
--header 'api-key: Axxxxxxxxxxxxxxxxxxxxxxxxxxxx3'
Updated 6 days ago