お使いのアカウント代理人によりサブアカウントが有効にされていない場合、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 の場合のみ、返されます。
|