Usa questo endpoint per scaricare un report. Per ottenere report-identifier
e report-run-identifier
, usa l’endpoint Cronologia report.
La funzione Libreria report deve essere abilitata nel tuo account affinché questo endpoint risponda correttamente.
curl -X GET \
'https://www.digicert.com/services/v2/report/{{report-identifier}}/{{report-run-identifier}}download?report_format={{report_format}}' \
-H 'Content-Type: application/json' \
-H 'X-DC-DEVKEY: {{api_key}}'
import requests
url = "https://www.digicert.com/services/v1/report/{{report-identifier}}/{{report-run-identifier}}/download?report_format={{report_format}}"
payload={}
headers = {
'Content-Type': 'application/json',
'X-DC-DEVKEY': '{{api_key}}',
}
response = requests.request("GET", url, headers=headers, data=payload)
print(response.text)
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://www.digicert.com/services/v1/report/{{report-identifier}}/{{report-run-identifier}}/download?report_format={{report_format}}"
method := "GET"
client := &http.Client {
}
req, err := http.NewRequest(method, url, nil)
if err != nil {
fmt.Println(err)
return
}
req.Header.Add("Content-Type", "application/json")
req.Header.Add("X-DC-DEVKEY", "{{api_key}}")
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()
body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
var request = require('request');
var options = {
'method': 'GET',
'url': 'https://www.digicert.com/services/v1/report/{{report-identifier}}/{{report-run-identifier}}/download?report_format={{report_format}}',
'headers': {
'Content-Type': 'application/json',
'X-DC-DEVKEY': '{{api_key}}',
}
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
No content
{
"code": "report_format_inapplicable",
"message": "The given report format is not applicable for the template/report."
}
{
"code": "missing_mandatory_fields",
"message": "Please provide values for mandatory fields"
}
{
"code": "user_authentication_error",
"message": "User is not authenticated."
}
{
"code": "user_forbidden",
"message": "User does not have the required permission."
}
{
"code": "custom_reports_not_enabled",
"message": "Custom reports is not enabled"
}
{
"code": "reports_not_found",
"message": "Report with the given identifier does not exist."
}
{
"code": "report_not_found",
"message": "Report with the given identifier does not exist."
}
Nome | Rich/Opz | Tipo | Descrizione |
---|---|---|---|
report-identifier | obbligatorio | uuid | ID report. Trova l’ID report con l’API Cronologia report. |
report-run-identifier | obbligatorio | uuid | ID associato alla programmazione del report. Trova l’identificatore di esecuzione report con l’API Cronologia report. |
Nome | Rich/Opz | Tipo | Descrizione |
---|---|---|---|
report_format | obbligatorio | string |
Formato per il report scaricato. Formati supportati: CSV, JSON, ZIP .
|
Il file di report scaricato viene salvato come "<display_name>-<data-download-report nel formato AAA-MM-GG>.<file_format>. L’estensione file si basa sul <codice>report_format</codice> specificato nell’API Crea report.