列出容器

GET
https://www.digicert.com/services/v2/container

使用此端點列出您帳戶中的所有容器。

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

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

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/container"

	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/container',
  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
{
  "containers": [
    {
      "id": 3,
      "public_id": "<public_id>",
      "name": "Company Name, Inc.",
      "parent_id": 0,
      "template_id": 5,
      "ekey": "<ekey>",
      "has_logo": true,
      "is_active": true,
      "allowed_domain_names": [
        "example.com"
      ]
    },
    {
      "id": 11224,
      "public_id": "<public_id>",
      "name": "History department",
      "description": "For the history department.",
      "parent_id": 3,
      "template_id": 6,
      "ekey": "<ekey>",
      "has_logo": false,
      "is_active": true,
      "allowed_domain_names": [
        "example1.com"
      ],
      "organization_assignments": [
        {
          "id": 7,
          "status": "active",
          "name": "Organization Name, LLC",
          "display_name": "Organization Name",
          "is_active": "1"
        }
      ]
    },
    {
      "id": 11225,
      "public_id": "<public_id>",
      "name": "IT department",
      "description": "For the IT department.",
      "parent_id": 3,
      "template_id": 6,
      "ekey": "<ekey>",
      "has_logo": false,
      "is_active": true,
      "user_id_assignments": [
        "123456"
      ],
      "allowed_domain_names": [
        "example2.com",
        "example3.com"
      ]
    }
  ]
}

回應參數

名稱 類型 說明
containers array 所有容器的清單。
.. id int 容器 ID。
.. public_id string 容器的公用 ID。
.. name string 容器的名稱。
.. description string 容器的說明。
.. parent_id int 容器的父項的 ID。
.. template_id int 容器的範本 ID。
.. has_logo bool 容器的自訂標誌狀態。
.. is_active bool 容器的啟用狀態。
.. user_id_assignments array 指派給容器的使用者的清單。
.. allowed_domain_names array 可以搭配容器使用的網域的清單。
.. organization_assignments array 指派給容器的組織物件的清單。