Read request logs
An unavailable source is distinct from an empty matching result. Date filters use RFC3339 timestamps. Requires List distributions.
GET
/
cloud-cdn
/
distributions
/
logs
Read request logs
curl --request GET \
--url https://api.aptranet.com/cloud-cdn/distributions/logs \
--header 'Aptranet-Secret: <api-key>' \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.aptranet.com/cloud-cdn/distributions/logs"
headers = {
"Authorization": "Bearer <token>",
"Aptranet-Secret": "<api-key>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {Authorization: 'Bearer <token>', 'Aptranet-Secret': '<api-key>'}
};
fetch('https://api.aptranet.com/cloud-cdn/distributions/logs', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.aptranet.com/cloud-cdn/distributions/logs"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Aptranet-Secret", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"data": [
{
"timestamp": 123,
"client_ip": "<string>",
"method": "<string>",
"path": "<string>",
"referer": "<string>",
"user_agent": "<string>",
"status": 123,
"size": 123,
"resource_id": 123,
"cache_status": "<string>",
"datacenter": "<string>",
"cname": "<string>",
"sent_http_content_type": "<string>",
"tcpinfo_rtt": 123
}
],
"meta": {
"count": 123
},
"unavailable": true
}{
"error": "<string>",
"error_description": "<string>"
}Authorizations
Project API access key.
Current secret for the access key.
Query Parameters
Required range:
x >= 1Read request logs
curl --request GET \
--url https://api.aptranet.com/cloud-cdn/distributions/logs \
--header 'Aptranet-Secret: <api-key>' \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.aptranet.com/cloud-cdn/distributions/logs"
headers = {
"Authorization": "Bearer <token>",
"Aptranet-Secret": "<api-key>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {Authorization: 'Bearer <token>', 'Aptranet-Secret': '<api-key>'}
};
fetch('https://api.aptranet.com/cloud-cdn/distributions/logs', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.aptranet.com/cloud-cdn/distributions/logs"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Aptranet-Secret", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"data": [
{
"timestamp": 123,
"client_ip": "<string>",
"method": "<string>",
"path": "<string>",
"referer": "<string>",
"user_agent": "<string>",
"status": 123,
"size": 123,
"resource_id": 123,
"cache_status": "<string>",
"datacenter": "<string>",
"cname": "<string>",
"sent_http_content_type": "<string>",
"tcpinfo_rtt": 123
}
],
"meta": {
"count": 123
},
"unavailable": true
}{
"error": "<string>",
"error_description": "<string>"
}