列出子帐户

GET
https://www.digicert.com/services/v2/account/subaccount

使用此端点列出所有子帐户。

cURL
curl -X GET \
  https://www.digicert.com/services/v2/account/subaccount \
  -H 'Content-Type: application/json' \
  -H 'X-DC-DEVKEY: {{api_key}}'
Python
import requests

url = "https://www.digicert.com/services/v2/account/subaccount"

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

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

print(response.text)
Go
package main

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

func main() {

	url := "https://www.digicert.com/services/v2/account/subaccount"

	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/account/subaccount',
  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
{
  "subaccounts": [
    {
      "account_id": 112233,
      "account_type": "reseller",
      "organization_name": "Number one organization",
      "date_created": "2018-11-29 01:48:04",
      "account_manager": "Jim James"
    },
    {
      "account_id": 112234,
      "account_type": "enterprise",
      "organization_name": "Number two organization",
      "date_created": "2018-11-29 18:25:04",
      "account_manager": "Jill Valentine"
    },
    {
      "account_id": 112235,
      "account_type": "retail",
      "organization_name": "Number three organization",
      "date_created": "2018-12-04 15:24:43",
      "account_manager": "Rick Roll"
    }
  ],
  "page": {
    "total": 3,
    "limit": 1000,
    "offset": 0
  }
}

URL 查询字符串

名称 请求/选项 类型 描述
offset 可选 int 在特定分页页码开始列表。
默认值:0
limit 可选 int 将列表截断到指定的分页页码。
最大值:1000(默认)

响应参数

名称 类型 描述
child_accounts array 所有子帐户的列表。
.. account_id int 帐号。
.. account_type string 定义子帐户类型。
请参阅词汇表 - 子帐户类型
.. organization_name string 子帐户主要组织的法定名称。
.. date_created string 创建子帐户的时间戳。
格式:yyyy-MM-dd HH:mm:ss
.. account_manager string 子帐户的帐户代表的姓名。
页码 object 关于结果的详细信息。
使用 URL 查询字符串进行修改。