设置子帐户产品

PUT
https://www.digicert.com/services/v2/account/subaccount/{{subaccount_id}}/products

使用此端点设置子帐户的产品限制。

此端点对 product_limits 数组具有破坏性。现有数组将被发送的新数组覆盖。

cURL
curl -X PUT \
  'https://www.digicert.com/services/v2/account/subaccount/{{subaccount_id}}/product-limits' \
  -H 'Content-Type: application/json' \
  -H 'X-DC-DEVKEY: {{api_key}}' \
  -d '{
  "product_limits": [
    {
      "product_name_id": "ssl_dv_geotrust"
    },
    {
      "product_name_id": "ssl_multi_domain"
    },
    {
      "product_name_id": "ssl_plus"
    },
    {
      "product_name_id": "ssl_wildcard"
    },
    {
      "product_name_id": "wildcard_dv_geotrust"
    }
  ]
}'
Python
import requests

url = "https://www.digicert.com/services/v2/account/subaccount/{{subaccount_id}}/product-limits"

payload = "{\n  \"product_limits\": [\n    {\n      \"product_name_id\": \"ssl_dv_geotrust\"\n    },\n    {\n      \"product_name_id\": \"ssl_multi_domain\"\n    },\n    {\n      \"product_name_id\": \"ssl_plus\"\n    },\n    {\n      \"product_name_id\": \"ssl_wildcard\"\n    },\n    {\n      \"product_name_id\": \"wildcard_dv_geotrust\"\n    }\n  ]\n}"
headers = {
    'X-DC-DEVKEY': "{{api_key}}",
    'Content-Type': "application/json"
    }

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

print(response.text)
Go
package main

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

func main() {

	url := "https://www.digicert.com/services/v2/account/subaccount/{{subaccount_id}}/product-limits"

	payload := strings.NewReader("{\n  \"product_limits\": [\n    {\n      \"product_name_id\": \"ssl_dv_geotrust\"\n    },\n    {\n      \"product_name_id\": \"ssl_multi_domain\"\n    },\n    {\n      \"product_name_id\": \"ssl_plus\"\n    },\n    {\n      \"product_name_id\": \"ssl_wildcard\"\n    },\n    {\n      \"product_name_id\": \"wildcard_dv_geotrust\"\n    }\n  ]\n}")

	req, _ := http.NewRequest("PUT", url, payload)

	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: 'PUT',
  url: 'https://www.digicert.com/services/v2/account/subaccount/{{subaccount_id}}/product-limits',
  headers: 
   { 'Content-Type': 'application/json',
     'X-DC-DEVKEY': '{{api_key}}' },
  body: 
   { product_limits: 
      [ { product_name_id: 'ssl_dv_geotrust' },
        { product_name_id: 'ssl_multi_domain' },
        { product_name_id: 'ssl_plus' },
        { product_name_id: 'ssl_wildcard' },
        { product_name_id: 'wildcard_dv_geotrust' } ] },
  json: true };

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

  console.log(body);
});
204 No Content
// empty

发送空的 product_limits 数组将禁用子帐户的所有产品。

请求参数

名称 请求/选项 类型 描述
product_limits 必填 array 对子帐户启用的产品的列表。
.. product_name_id 可选 string 要启用的产品的名称 ID。