Download Logs

Last updated: 2019-11-29 17:43:42


1. API Description

This API (GetCdnLogList) is used to query the log download links of specified domain names within the specified time range. You can only query one domain at a time.

Domain name for API

Log download links API_V1: GenerateLogList

2. Input Parameters

The following request parameter list only provides API request parameters. Common request parameters need to be added when the API is called. For more information, refer to Common Request Parameters. The Action field for this API is GetCdnLogList.

Parameter Name Required Type Description
host Yes String Domain of the log to be queried
startDate No String Start time of the query. Format: 2016-12-30 00:00:00
endDate No String End time of the query. Format: 2016-12-30 01:00:00


  • If the startDate and endDate are empty, the default query range is 30 days before the current time. One log download link is provided per hour.
  • startDate indicates the start date of the query, and endDate indicates the end date of the query. The log packets between the time range specified in startDate and endDate will be returned. Assuming startDate=2016-12-30 00:01:00 and endDate=2016-12-30 02:12:00, the packets in three hours (2016123000, 2016123001, and 2016123002) will be returned;
  • If no access log is generated for an hour, the download link will not be generated or returned accordingly.
  • The log download link is valid for 24 hours.

3. Output Parameters

Parameter Name Type Description
code Int Common error code; 0: Succeeded; other values: Failed. For more information, refer to Common Error Codes on Error Code page.
message String Module error message description depending on API.
codeDesc String English error message or error code at business side.
data Array Result data, as described below

data Field Description

Parameter Name Type Description
now Int Current time, Unix timestamp
list Array List of log download links

list Field Description

Parameter Name Type Description
date Int Log date
type Int Indicate whether there is a log; 1: yes; 0: no
name String Log name. Format: yyyymmddhh-domain, for example:
link String Download link

4. Example

4.1 Input Example

startDate: 2016-12-30 00:00:01
endDate: 2016-12-30 05:12:00

4.2 GET Request

For GET request, all the parameters are required to be appended to the URL:

4.3 POST Request

For POST request, the parameters need to be filled in HTTP Request-body. The request address is:

Such formats as form-data and x-www-form-urlencoded are supported. The array of parameters is as follows:

array (
  'Action' => 'GetCdnLogList',
  'Timestamp' => 1462865760,
  'Nonce' => 1058191224,
  'host' => '',
  'startDate' => '2016-12-30 00:00:01',
  'endDate' => '2016-12-30 05:12:00'

4.4 Example of Returned Result

  "codeDesc": "Success",