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.

Request Format

To get the URL analytics data, use the following endpoint:

curl --location --request GET '<URL>/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

URL

String

Base URL based on region.

https://api.xx.kaleyra.io

True

SID

String

Account SID (Security Identifier).

HXXXXXXX071US

True

ID

Number

Txtly ID to delete the associated Txtly URL from the database.

317

True

PAGE

Number

The number of pages in which you wish to view the logs.

One page can have a maximum of 25 records.

1

False

API-KEY

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.xx.kaleyra.io/v1/HXXXXXXX071US/url-shortner/logs/317?page=1' \
--header 'api-key: Axxxxxxxxxxxxxxxxxxxxxxxxxxxx3'

Did this page help you?