如果您的帐户代表未启用子帐户,您将收到 access_denied|missing_permission
错误。
使用此端点创建新子帐户。
创建托管帐户时,仅此一次在响应主体的 api_key
参数中显示 API 密钥。它不会再次显示,而且一旦丢失将无法找回。
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 | 子帐户的帐号。 |
account_type | string | 子帐户的帐户类型。 |
account_manager_user_id | int | 子帐户管理员的用户 ID。 |
bill_parent | bool | 指定是否应对证书订单向父帐户收费。 |
organization | object | 子帐户主要组织的相关详细信息。 |
.. id | int | 组织编号。 |
.. 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 | 新子帐户的帐号。 |
.. first_name | string | 用户的名字。 |
.. last_name | string | 用户的姓氏。 |
string | 用户的电子邮件地址。 | |
.. job_title | string | 用户的职位名称。 |
.. telephone | string | 用户的电话号码。 |
.. type | string |
用户类型。 可能的值: standard
|
api_key | string |
为子帐户生成的 API 密钥。 仅当 subaccount_type 是 managed 时返回。
|