若您的客服代表尚未啟用子帳戶,您將會收到 access_denied|missing_permission
錯誤。
使用此端點以建立新子帳戶。
建立受管理的帳戶時,API 金鑰僅這一次在回應本文的 api_key
參數中顯示。再也不會顯示,而且若遺失沒有重新取回的方式。
curl -X POST \
https://www.digicert.com/services/v2/account \
-H 'Content-Type: application/json' \
-H 'X-DC-DEVKEY: {{api_key}}' \
-d '{
"account_type": "retail",
"allowed_grandchildren": [
"retail",
"enterprise",
"reseller"
],
"account_manager_user_id": 12345,
"user": {
"first_name": "John",
"last_name": "Smith",
"email": "john.smith@example.com",
"username": "john.smith@example.com",
"job_title": "Statistician",
"telephone": "111-222-333-4444"
},
"organization": {
"name": "Example Company, LLC",
"address": "123 Fake Street",
"address2": "Suite 321",
"zip": "93090",
"city": "Toledo",
"state": "AL",
"country": "US",
"telephone": "111-222-333-4445"
}
}'
import requests
url = "https://www.digicert.com/services/v2/account"
payload = "{\n \"account_type\": \"retail\",\n \"allowed_grandchildren\": [\n \"retail\",\n \"enterprise\",\n \"reseller\"\n ],\n \"account_manager_user_id\": 12345,\n \"user\": {\n \"first_name\": \"John\",\n \"last_name\": \"Smith\",\n \"email\": \"john.smith@example.com\",\n \"username\": \"john.smith@example.com\",\n \"job_title\": \"Statistician\",\n \"telephone\": \"111-222-333-4444\"\n },\n \"organization\": {\n \"name\": \"Example Company, LLC\",\n \"address\": \"123 Fake Street\",\n \"address2\": \"Suite 321\",\n \"zip\": \"93090\",\n \"city\": \"Toledo\",\n \"state\": \"AL\",\n \"country\": \"US\",\n \"telephone\": \"111-222-333-4445\"\n }\n}"
headers = {
'X-DC-DEVKEY': "{{api_key}}",
'Content-Type': "application/json"
}
response = requests.request("POST", url, data=payload, headers=headers)
print(response.text)
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://www.digicert.com/services/v2/account"
payload := strings.NewReader("{\n \"account_type\": \"retail\",\n \"allowed_grandchildren\": [\n \"retail\",\n \"enterprise\",\n \"reseller\"\n ],\n \"account_manager_user_id\": 12345,\n \"user\": {\n \"first_name\": \"John\",\n \"last_name\": \"Smith\",\n \"email\": \"john.smith@example.com\",\n \"username\": \"john.smith@example.com\",\n \"job_title\": \"Statistician\",\n \"telephone\": \"111-222-333-4444\"\n },\n \"organization\": {\n \"name\": \"Example Company, LLC\",\n \"address\": \"123 Fake Street\",\n \"address2\": \"Suite 321\",\n \"zip\": \"93090\",\n \"city\": \"Toledo\",\n \"state\": \"AL\",\n \"country\": \"US\",\n \"telephone\": \"111-222-333-4445\"\n }\n}")
req, _ := http.NewRequest("POST", 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))
}
var request = require("request");
var options = { method: 'POST',
url: 'https://www.digicert.com/services/v2/account',
headers:
{ 'Content-Type': 'application/json',
'X-DC-DEVKEY': '{{api_key}}' },
body:
{ account_type: 'retail',
allowed_grandchildren: [ 'retail', 'enterprise', 'reseller' ],
account_manager_user_id: 12345,
user:
{ first_name: 'John',
last_name: 'Smith',
email: 'john.smith@example.com',
username: 'john.smith@example.com',
job_title: 'Statistician',
telephone: '111-222-333-4444' },
organization:
{ name: 'Example Company, LLC',
address: '123 Fake Street',
address2: 'Suite 321',
zip: '93090',
city: 'Toledo',
state: 'AL',
country: 'US',
telephone: '111-222-333-4445' } },
json: true };
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
{
"id": 1122334,
"account_type": "retail",
"account_manager_user_id": 12345,
"organization": {
"id": 3344556,
"status": "active",
"name": "Example Company, LLC",
"display_name": "Example Company, LLC",
"is_active": true,
"address": "123 Fake Street",
"zip": "93090",
"city": "Toledo",
"state": "AL",
"country": "us",
"telephone": "111-222-333-4445",
"container": {
"id": 112234,
"parent_id": 0,
"name": "Example Company, LLC",
"is_active": true
}
},
"user": {
"id": 45321,
"username": "john.smith@example.com",
"account_id": 12121,
"first_name": "John",
"last_name": "Smith",
"email": "john.smith@example.com",
"job_title": "Statistician",
"telephone": "111-222-333-4444",
"type": "standard"
}
}
{
"id": 1122334,
"account_type": "managed",
"account_manager_user_id": 12345,
"organization": {
"id": 3344556,
"status": "active",
"name": "Example Company, LLC",
"display_name": "Example Company, LLC",
"is_active": true,
"address": "123 Fake Street",
"zip": "93090",
"city": "Toledo",
"state": "AL",
"country": "us",
"telephone": "111-222-333-4445",
"container": {
"id": 112234,
"parent_id": 0,
"name": "Example Company, LLC",
"is_active": true
}
},
"user": {
"id": 45321,
"username": "john.smith@example.com",
"account_id": 12121,
"first_name": "John",
"last_name": "Smith",
"email": "john.smith@example.com",
"job_title": "Statistician",
"telephone": "111-222-333-4444",
"type": "standard"
},
"api_key": "{{api_key}}"
}
名稱 | 必填/選填 | 類型 | 說明 |
---|---|---|---|
account_type | 必填 | string |
說明要建立的子帳戶類型。 請參閱詞彙 — 子帳戶類型 允許的值: standard ,enterprise ,reseller ,managed
|
allowed_grandchildren | 必填 | array |
可在帳戶下建立的帳戶類型的清況。 請參閱詞彙 — 子帳戶類型 允許的值: standard ,enterprise ,reseller
|
account_manager_user_id | 選填 | int | 管理子帳戶的現有使用者的 ID。 |
bill_parent | 選填 | bool |
指定是否應向所有憑證訂單的父項帳戶收費。 預設: false
|
user | 必填 | object | 與要建立的新子帳戶使用者有關的詳細資料。 |
.. first_name | 必填 | string | 子帳戶使用者的名字。 |
.. last_name | 必填 | string | 子帳戶使用者的姓氏。 |
必填 | string |
子帳戶使用者的電郵地址。 建立帳戶電郵將傳送到此位址。 |
|
.. username | 選填 | string |
用於登入子帳戶的使用者名稱。 如果忽略,將使用 email 值作為使用者名稱。
|
.. job_title | 選填 | string | 子帳戶使用者的職稱。 |
.. telephone | 選填 | string | 子帳戶使用者的電話號碼。 |
organization | 必填 | object | 與子帳戶的主要組織有關的詳細資料 |
.. name | 必填 | string | 組織的法律名稱。 |
.. assumed_name | 選填 | string |
組織的公用名稱。 也稱為 DBA 名稱。 |
.. address | 必填 | string | 組織的地址 |
.. address2 | 選填 | string | |
.. zip | 必填 | string | 組織的郵遞區號。 |
.. city | 必填 | string | 組織所位於的城市。 |
.. state | 必填 | string | 組織所位於的省。 |
.. country | 必填 | string | 組織所位於的國家。 |
.. telephone | 選填 | string | 組織電話號碼。 |
名稱 | 類型 | 說明 |
---|---|---|
id | int | 子帳戶的帳戶 ID。 |
account_type | string | 子帳戶的帳戶類型。 |
account_manager_user_id | int | 子帳戶管理員的使用者 ID。 |
bill_parent | bool | 指定是否向憑證訂單收取父項帳戶的費用。 |
organization | object | 與子帳戶的主要組織有關的詳細資料。 |
.. id | int | 組織 ID。 |
.. status | string |
組織狀態。 可能的值: active ,inactive
|
.. name | string | 組織的法律名稱。 |
.. assumed_name | string |
組織的公用名稱。 也稱為 DBA 名稱。 |
.. display_name | string |
組織的完整名稱。 使用名稱 + assumed_name 建構。 |
.. is_active | bool | 組織的啟用狀態。 |
.. address | string | 組織的地址 |
.. address2 | string | |
.. zip | string | 組織的郵遞區號。 |
.. city | string | 組織所位於的城市。 |
.. state | string | 組織所位於的省。 |
.. country | string | 組織所位於的國家。 |
.. telephone | string | 組織電話號碼。 |
.. container | object | 附加組織的主要容器。 |
.. .. id | int | 容器 ID。 |
.. .. parent_id | int | 容器的父項的 ID。 |
.. .. name | string | 容器的名稱。 |
.. .. is_active | bool | 組織的啟用狀態。 |
user | object | 與新子帳戶使用者有關的詳細資料。 |
.. id | int | 使用者 ID。 |
.. username | string | 用於登入子帳戶的使用者名稱。 |
.. account_id | int | 新子帳戶的帳戶 ID。 |
.. first_name | string | 使用者的名字。 |
.. last_name | string | 使用者的姓氏。 |
string | 使用者的電郵地址。 | |
.. job_title | string | 使用者的職稱。 |
.. telephone | string | 使用者的電話號碼。 |
.. type | string |
使用者類型。 可能的值: standard
|
api_key | string |
產生的子帳戶的 API 金鑰。 僅在 subaccount_type 是 managed 時傳回。
|