HTML-копии и скриншоты: методы API
Скачивайте HTML-копию или PNG-скриншот страницы выбранного отчёта. Справочник описывает два метода, идентификаторы и ответы при ошибках.
В этой статье
- GET /public-api/v1/diff-projects/{id}/reports/{report_id}/pages/{url_md5}/html
- GET /public-api/v1/diff-projects/{id}/reports/{report_id}/pages/{url_md5}/screenshot
Выберите метод в оглавлении. Проверьте его HTTP-метод, путь, права доступа, обязательные параметры и тело запроса. JSON-блоки со словами schema, properties и $ref описывают контракт; их не нужно отправлять как готовое тело запроса. Примеры запросов и схемы ответов подписаны отдельно.
GET /public-api/v1/diff-projects/{id}/reports/{report_id}/pages/{url_md5}/html
Параметры
Связанные модели данных: CacheControl · RateLimitLimit · RateLimitRemaining · RateLimitResetAt · RetryAfter · XRequestID · ErrorResponse · URLMD5 · XID
id (path)
{
"required": true,
"schema": {
"$ref": "#/components/schemas/XID"
}
}
report_id (path)
Xid отчёта или литерал last. Литерал last принимается только в этом параметре пути.
{
"required": true,
"schema": {
"type": "string",
"minLength": 4,
"maxLength": 64,
"pattern": "^([A-Za-z0-9_-]+|last)$"
}
}
url_md5 (path)
{
"required": true,
"schema": {
"$ref": "#/components/schemas/URLMD5"
}
}
Ответы
200
Сохранённый HTML-файл.
{
"headers": {
"X-Request-ID": {
"$ref": "#/components/headers/XRequestID"
},
"Content-Disposition": {
"schema": {
"type": "string"
}
}
},
"content": {
"text/html": {
"schema": {
"type": "string"
}
}
}
}
default
Для отсутствующего или неверного ключа заголовки лимита относятся к неудачным попыткам с IP. После авторизации они описывают применимый лимит ключа или аккаунта. При блокировке до проверки лимита или недоступности счётчика заголовки могут отсутствовать. X-RateLimit-Reset — Unix timestamp в секундах; Retry-After при 429 — задержка в секундах.
{
"headers": {
"X-Request-ID": {
"$ref": "#/components/headers/XRequestID"
},
"X-RateLimit-Limit": {
"$ref": "#/components/headers/RateLimitLimit"
},
"X-RateLimit-Remaining": {
"$ref": "#/components/headers/RateLimitRemaining"
},
"X-RateLimit-Reset": {
"$ref": "#/components/headers/RateLimitResetAt"
},
"Cache-Control": {
"$ref": "#/components/headers/CacheControl"
},
"Retry-After": {
"$ref": "#/components/headers/RetryAfter"
}
},
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
}
GET /public-api/v1/diff-projects/{id}/reports/{report_id}/pages/{url_md5}/screenshot
Параметры
Связанные модели данных: CacheControl · RateLimitLimit · RateLimitRemaining · RateLimitResetAt · RetryAfter · XRequestID · ErrorResponse · URLMD5 · XID
id (path)
{
"required": true,
"schema": {
"$ref": "#/components/schemas/XID"
}
}
report_id (path)
Xid отчёта или литерал last. Литерал last принимается только в этом параметре пути.
{
"required": true,
"schema": {
"type": "string",
"minLength": 4,
"maxLength": 64,
"pattern": "^([A-Za-z0-9_-]+|last)$"
}
}
url_md5 (path)
{
"required": true,
"schema": {
"$ref": "#/components/schemas/URLMD5"
}
}
device (query)
{
"schema": {
"type": "string",
"enum": [
"desktop",
"mobile"
],
"default": "desktop"
}
}
Ответы
200
Сохранённый скриншот PNG.
{
"headers": {
"X-Request-ID": {
"$ref": "#/components/headers/XRequestID"
}
},
"content": {
"image/png": {
"schema": {
"type": "string",
"format": "binary"
}
}
}
}
default
{
"headers": {
"X-Request-ID": {
"$ref": "#/components/headers/XRequestID"
},
"X-RateLimit-Limit": {
"$ref": "#/components/headers/RateLimitLimit"
},
"X-RateLimit-Remaining": {
"$ref": "#/components/headers/RateLimitRemaining"
},
"X-RateLimit-Reset": {
"$ref": "#/components/headers/RateLimitResetAt"
},
"Cache-Control": {
"$ref": "#/components/headers/CacheControl"
},
"Retry-After": {
"$ref": "#/components/headers/RetryAfter"
}
},
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
}