列出支持的报告类型

GET
https://api.digicert.com/reports/v1/report/types

使用此端点列出支持的报告类型。

必须在帐户中启用报告库功能,该端点才能成功响应。

cURL
curl -X GET \
  'https://www.digicert.com/services/v1/reports/preview/report/types' \
  -H 'Content-Type: application/json' \
  -H 'X-DC-DEVKEY: {{api_key}}'
Python
import requests

url = "https://www.digicert.com/services/v1/reports/preview/report/types"

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/reports/preview/report/types"
  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/reports/preview/report/types',
  '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 OK
{
    "report_types": [
        {
            "report_type": "orders",
            "display_name": "Orders",
            "supported_formats": [ 
                "CSV",
                "JSON"   
            ]
        }
    ]
}
401 Invalid user
{
"code": "user_authentication_error",
"message": "User is not authenticated."
}
401 Invalid URL
404 page not found
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"
}

响应参数

名称 类型 描述
report_types object 含有报告详情的容器。
.. report_type string 所创建报告的类型。
.. display_name string 所显示报告的名称。
.. supported_formats [字符串] 支持的报告文件类型。目前支持CSVJSON