容器權限

GET
https://www.digicert.com/services/v2/authorization/{{permission}}/container

使用此端點列出所有獲得授權的容器以執行權限動作。

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

url = "https://www.digicert.com/services/v2/authorization/{{permission}}/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/authorization/{{permission}}/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/authorization/{{permission}}/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": 10001,
      "parent_id": 0,
      "name": "My Organization",
      "is_active": true
    },
    {
      "id": 10022,
      "parent_id": 10001,
      "name": "IT",
      "is_active": true
    },
    {
      "id": 10023,
      "parent_id": 10001,
      "name": "Accounting",
      "is_active": true
    },
    {
      "id": 10024,
      "parent_id": 10001,
      "name": "SREs",
      "is_active": true
    }
  ]
}

回應本文

名稱 類型 說明
containers array 有指定權限的容器的清單。
.. id int 容器 ID。
.. parent_id int 父項容器的 ID。
0 的值表示帳戶的主要容器。
.. name string 容器的名稱。
.. is_active bool 容器的啟用狀態。
可能的值:true, false