Przejdź do treści

Download Report

Pobiera raport z konkretnym ID. Zwraca raport z nagłówkiem Content-Disposition: Attachment.

GET /report/{report_id}/download

URL Parameters

Nazwa Rodzaj Opcjonalne Opis
report_id <STRING> 5ezp67c2f03ww453ad1ae42a Identyfikator systemowy Report

Response Code

Status Opis
200 Rekord został pobrany pomyślnie
503 Serwis niedostępny

Example

curl -X GET \
    $CONPEEK_URL/report/5ezp67c2f03ww453ad1ae42a/download \
    -H 'Authorization: '$CONPEEK_KEY \
    -H 'Content-Type: application/json'
import requests
import os
from urllib import parse

report_id = "5ezp67c2f03ww453ad1ae42a"
url = parse.urljoin(os.environ["CONPEEK_URL"], f"report/{report_id}/download")

headers = {
    'Content-Type': "application/json",
    'Authorization': os.environ["CONPEEK_KEY"]
}

response = requests.request("GET", url, headers=headers)
print(response.text)
<?php
$curl = curl_init();
$report_id = "5ezp67c2f03ww453ad1ae42a";

curl_setopt_array($curl, array(
    CURLOPT_URL => getenv("CONPEEK_URL")."/report/$report_id/download",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 30,
    CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
    CURLOPT_CUSTOMREQUEST => "GET",
    CURLOPT_HTTPHEADER => array(
        "Authorization: ".getenv("CONPEEK_KEY"),
        "Content-Type: application/json"
    ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
    echo "cURL Error #:" . $err;
} else {
    echo $response;
}