列出子帳戶

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 帳戶 ID。
.. account_type string 定義子帳戶類型。
請參閱詞彙 — 子帳戶類型
.. organization_name string 子帳戶的主要組織的法律名稱。
.. date_created string 建立子帳戶時的時間戳記。
格式:yyyy-MM-dd HH:mm:ss
.. account_manager string 子帳戶的帳戶代碼的名稱。
頁面 object 與結果有關的詳細資料。
使用 URL 查詢字串修改。