状态更改列表

GET
https://www.digicert.com/services/v2/order/certificate/status-changes

使用此端点列出在指定的时间段内发生状态更改的订单。

如果总时间超过 10080 分钟(7 天),则返回 time_frame_too_long 错误。

cURL
curl -X GET \
  'https://www.digicert.com/services/v2/order/certificate/status-changes?minutes=10' \
  -H 'Content-Type: application/json' \
  -H 'X-DC-DEVKEY: {{api_key}}'
Python
import requests

url = "https://www.digicert.com/services/v2/order/certificate/status-changes"

querystring = {"minutes":"10"}

payload = ""
headers = {
    'X-DC-DEVKEY': "{{api_key}}",
    'Content-Type': "application/json"
    }

response = requests.request("GET", url, data=payload, headers=headers, params=querystring)

print(response.text)
Go
package main

import (
	"fmt"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://www.digicert.com/services/v2/order/certificate/status-changes?minutes=10"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("X-DC-DEVKEY", "{{api_key}}")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
NodeJS
var request = require("request");

var options = { method: 'GET',
  url: 'https://www.digicert.com/services/v2/order/certificate/status-changes',
  qs: { minutes: '10' },
  headers: 
   { 'Content-Type': 'application/json',
     'X-DC-DEVKEY': '{{api_key}}' } };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
200 OK
{
  "orders": [
    {
      "order_id": 265,
      "certificate_id": 112233,
      "status": "issued"
    },
    {
      "order_id": 264,
      "certificate_id": 112232,
      "status": "canceled"
    },
    {
      "order_id": 263,
      "certificate_id": 112231,
      "status": "issued"
    },
    {
      "order_id": 262,
      "certificate_id": 112230,
      "status": "rejected"
    },
    {
      "order_id": 261,
      "certificate_id": 112229,
      "status": "issued"
    },
    {
      "order_id": 260,
      "certificate_id": 112228,
      "status": "issued"
    },
    {
      "order_id": 259,
      "certificate_id": 112227,
      "status": "issued"
    }
  ]
}
200 OK (no orders found)
{}
400 Bad Request
{
  "errors": [
    {
      "code": "time_frame_too_long",
      "message": "An error occurred while processing your request."
    }
  ]
}

URL 查询字符串

在请求中必须包含至少一个 URL 查询字符串筛选项。

名称 请求/选项 类型 描述
minutes 可选 int 限制结果为在过去 n 分钟内的状态更改。
最大值:10080
seconds 可选 int 要添加到查询时间的秒数。
筛选项[status_last_updated] 可选 日期 限制结果为在指定日期范围内的状态更改。
格式:{{yyyy-MM-dd}}+{{HH:mm:ss}}...{{yyyy-MM-dd}}+{{HH:mm:ss}}
示例: 2019-08-01+00:00:00...2019-08-07+23:59:59

响应参数

名称 类型 描述
orders array 在指定的时间段内发生状态更改的订单的列表。
.. order_id int 订单编号。
.. certificate_id int 证书编号。
.. status string 当前订单状态。
请参阅词汇表 - 订单状态