Development Document

Log Download Download PDF Document

Endpoint

Request URL: stat/log/getList (GET)

Endpoint Domain Name: cdn.api.baishan.com
Endpoint Version: v2

Endpoint Description

Get the download URL of raw logs for the specified domain name.

Note: Logs are reserved for 14 days. Please make sure to download before the expiration. Request frequency limit can be found the response header, X-Ratelimit-Limit.

API Parameters

Note:Please request an API token from your BaishanCloud account team.

Request Parameters (GET)

Specify request parameters in the URL query strings, i.e. ?key1=value1&key2=value2.

ParameterData TypeRequirementDescription
domainsstringRequiredA single domain name. E.g. aa.qingcdn.com
start_timestringRequiredStart time, format (YYYY-MM-DD and YYYY-MM-DD HH:ii). If 2017-04-26 is the value, the system will interpret the start time as 2017-04-26 00:00.
end_timestringRequiredEnd time, format (YYYY-MM-DD and YYYY-MM-DD-HH:ii). If 2017-04-26 is the value, the system will interpret the end time as 2017-04-26 23:59.
with_typestringOptionalUse the value Video_log to retrieve live streaming logs. E.g.with_type=video_log
need_md5intOptional0: Default. Does not return MD5 data.
1: Download log data with MD5 information.
need_sizeintOptional0: Default. Does not return size data.
1: Download log data with size information.

Sample Request:

curl -X GET
"https://cdn.api.baishan.com/v2/stat/log/getList?token=xxx&start_time=2018-02-03&end_time=2018-02-03&domain=aa.qingcdn.com&need_md5=1&need_size=1"

Sample Response

{
    "code": 0, //0 = Success. Other code is displayed if the request failed. 
    "data": [
        {
            "domain": "aa.qingcdn.com",
            "date": "2018-02-03 00:00",
            "type": "1",//1=General log, 2=Live streaming log
            "url": "http://xxxxx/cdnlog/aa.qingcdn.com/201802030000.gz?AWSAccessKeyId=v0l8ci2mrxowhnbz6e1q&Expires=1518197410&Signature=NvmPNmztJHO9C4ZIYZScH2wJO7s%3D"
            "md5": "12ee210scb41cfd6311ec22c2c9ssf64",
            "size": 4235  
        }
    ]
}
Note: When the domain name does not have traffic, the returned data is empty.

{
    "code":0,
    "data":[]
}

Response Header

HTTP/1.0 200 OK
Api-Id:               63832415
Content-Type:          application/json; charset=utf-8
X-Ratelimit-Grad:      minute  
X-Ratelimit-Limit:     300  
X-Ratelimit-Remaining: 299   
X-Retry-After:         50     

HTTP Status Codes

Error CodeDescription
404Bad request URLs.
401Authorization Error: Invalid token or lack of access.
400Bad request parameters.
200Success.
5xxPlease contact your account team.
CopyRight © 2015-2022 BaishanCloud . All Rights Reserved.