下載報告

GET
https://api.digicert.com/reports/v1/report/{{report_identifier}}/{{report_run_identifier}}/download?report_format={{report_format}}

使用此端點下載報告。若要取得 report-identifierreport-run-identifier,請使用「報告歷史記錄」端點。

若要讓此端點成功回應,您必須在您的帳戶中啟用「報告程式庫」功能。

cURL
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}}'
Python
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)
Go
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))
}
NodeJS
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);
});
200 200 No content
No content
400 Invalid format
{
"code": "report_format_inapplicable",
"message": "The given report format is not applicable for the template/report."
}
400 Missing format
{
"code": "missing_mandatory_fields",
"message": "Please provide values for mandatory fields"
}
401 Invalid user
{
"code": "user_authentication_error",
"message": "User is not authenticated."
}
403 Forbidden
{
    "code": "user_forbidden",
    "message": "User does not have the required permission."
}
403 Not enabled
{
    "code": "custom_reports_not_enabled",
    "message": "Custom reports is not enabled"
}
404 Report not found
{
    "code": "reports_not_found",
    "message": "Report with the given identifier does not exist."
}
404 Report not found
{
"code": "report_not_found",
"message": "Report with the given identifier does not exist."
}

要求參數

名稱 必填/選填 類型 說明
report-identifier 必填 uuid 報告 ID。使用「報告歷史記錄 API」尋找報告 ID。
report-run-identifier 必填 uuid 與報告的排程關聯的 ID。使用報告歷史記錄 API 尋找 report-run-identifier。

查詢參數

名稱 必填/選填 類型 說明
report_format 必填 string 下載的報告的格式。支援的格式:CSV, JSON, ZIP

下載的報告檔案以「年-月-日」格式另存為 "<display_name>-<report-download-date>。<file_format>.副檔名以建立報告 API 中指定的 <code>report_format</code> 為依據。