DescribeUniqueVisitor

1. API Description

This API (DescribeUniqueVisitor) is used to query the number of unique visitors for a CDN.

2. Request Parameters

The following table lists the required request parameters for the API:

Parameter Name
Required
Type
Description

startTime

Yes

String

The beginning of the time range to query. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.

endTime

Yes

String

The end of the time range to query. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC. Note: The end time must be later than the start time.

domain

Yes

String

Accelerated domain

3. Output Parameterss

Parameter Name
Type
Description

dataSet

Array of VisitData

Number of unique visitors.

requestId

String

Unique request ID, which is returned with every request. This request ID is needed to locate issues.

4. Code Example

  1. Query CDN Unique Visitors.

POST / HTTP/1.1
Host: console.zenlayer.com/api/v2/cdn
Content-Type: application/json
X-TC-Action: DescribeUniqueVisitor
<Common Request Params>

Request:
{
    "startTime": "2022-09-21T00:00:00Z",
    "endTime": "2022-09-21T00:00:00Z",
    "domain": "www.xxx.com"
}

Response:
{
    "requestId": "T6883FCD0-3E7D-44EA-A517-A421A52A27F4",
    "response": {
        "requestId": "T6883FCD0-3E7D-44EA-A517-A421A52A27F4",
        "dataSet": [{
            "count": 40,
            "time": "2022-09-21T00:00:00Z",
            "traffic": 326.99
        },
        {
            "count": 12,
            "time": "2022-09-24T00:00:00Z",
            "traffic": 0.12
        }]
    }
}

5. Error Codes

The following includes error codes encountered in business logic. For other error codes, see Common Error Codes.

Last updated