此端點自動基於提交的資料判斷要求的適當 SSL 產品。如果無法判斷產品,則傳回 400 ambiguous_product
錯誤。
使用此端點提交使用產品 type_hint
的憑證要求。
curl -X POST \
https://www.digicert.com/services/v2/order/certificate/ssl \
-H 'Content-Type: application/json' \
-H 'X-DC-DEVKEY: {{api_key}}' \
-d '{
"certificate": {
"common_name": "example.com",
"dns_names": [
"example2.com",
"example3.com"
],
"csr": "<csr>",
"signature_hash": "sha256",
"organization_units": [
"Not Fake Company Inc."
],
"organization": {
"id": 112233
},
"server_platform": {
"id": 2
}
},
"validity_years": 1,
"comments": "Example certificate for API documentation.",
"container": {
"id": 11
},
"product": {
"type_hint": "ov"
},
"auto_renew": 1,
"disable_renewal_notifications": false,
"additional_emails": [
"john.smith@digicert.com"
],
"disable_ct": false,
"skip_approval": true,
"organization": {
"id": 112233
}
}'
import requests
url = "https://www.digicert.com/services/v2/order/certificate/ssl"
payload = "{\n \"certificate\": {\n \"common_name\": \"example.com\",\n \"dns_names\": [\n \"example2.com\",\n \"example3.com\"\n ],\n \"csr\": \"<csr>\",\n \"signature_hash\": \"sha256\",\n \"organization_units\": [\n \"Not Fake Company Inc.\"\n ],\n \"organization\": {\n \"id\": 112233\n },\n \"server_platform\": {\n \"id\": 2\n }\n },\n \"validity_years\": 1,\n \"comments\": \"Example certificate for API documentation.\",\n \"container\": {\n \"id\": 11\n },\n \"product\": {\n \"type_hint\": \"ov\"\n },\n \"auto_renew\": 1,\n \"disable_renewal_notifications\": false,\n \"additional_emails\": [\n \"john.smith@digicert.com\"\n ],\n \"disable_ct\": false,\n \"skip_approval\": true,\n \"organization\": {\n \"id\": 112233\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/order/certificate/ssl"
payload := strings.NewReader("{\n \"certificate\": {\n \"common_name\": \"example.com\",\n \"dns_names\": [\n \"example2.com\",\n \"example3.com\"\n ],\n \"csr\": \"<csr>\",\n \"signature_hash\": \"sha256\",\n \"organization_units\": [\n \"Not Fake Company Inc.\"\n ],\n \"organization\": {\n \"id\": 112233\n },\n \"server_platform\": {\n \"id\": 2\n }\n },\n \"validity_years\": 1,\n \"comments\": \"Example certificate for API documentation.\",\n \"container\": {\n \"id\": 11\n },\n \"product\": {\n \"type_hint\": \"ov\"\n },\n \"auto_renew\": 1,\n \"disable_renewal_notifications\": false,\n \"additional_emails\": [\n \"john.smith@digicert.com\"\n ],\n \"disable_ct\": false,\n \"skip_approval\": true,\n \"organization\": {\n \"id\": 112233\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/order/certificate/ssl',
headers:
{ 'Content-Type': 'application/json',
'X-DC-DEVKEY': '{{api_key}}' },
body:
{ certificate:
{ common_name: 'example.com',
dns_names: [ 'example2.com', 'example3.com' ],
csr: '<csr>',
signature_hash: 'sha256',
organization_units: [ 'Not Fake Company Inc.' ],
organization: { id: 112233 },
server_platform: { id: 2 } },
validity_years: 1,
comments: 'Example certificate for API documentation.',
container: { id: 11 },
product: { type_hint: 'ov' },
auto_renew: 1,
disable_renewal_notifications: false,
additional_emails: [ 'john.smith@digicert.com' ],
disable_ct: false,
skip_approval: true,
organization: { id: 112233 } },
json: true };
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
{
"id": 112233,
"requests": [
{
"id": 113,
"status": "pending"
}
]
}
{
"id": 112233,
"requests": [
{
"id": 113,
"status": "submitted"
}
]
}
{
"id": 112233,
"requests": [
{
"id": 113,
"status": "approved"
}
],
"certificate_id": 113
}
如需有關允許的憑證欄位值的資訊,請參閱公開受信任的憑證 – 違反業界標準的資料條目。
名稱 | 必填/選填 | 類型 | 說明 |
---|---|---|---|
憑證 | 必填 | 物件 | |
.. common_name | 必填 | string | 要保護安全的網域。 |
.. dns_names | 選填 | array |
要保護安全的其他網域。 可能產生其他成本。(請參閱最佳做法 — 免費取得兩個版本的網域。) |
.. csr | 必填* | string |
憑證簽章要求 (CSR)。 *請參閱詞彙 — CSR 需求 |
.. signature_hash | 必填 | string |
用於簽署憑證的雜湊演算法。 Code signing (代碼簽章) 憑證僅支援 SHA-256。 |
.. ca_cert_id | 必填* | string |
應簽署憑證的 CA 憑證的 ID。 *僅在 type_hint 為 private 時必填。
|
.. organization_units | 選填 | array | 憑證針對的您的組織的部門。 |
.. server_platform | 選填 | object |
伺服器平台類型。 代碼簽章憑證訂單所需。 預設: -1 (其他)
|
.. .. id | 必填 | int |
伺服器平台 ID。 請參閱詞彙 — 伺服器平台 |
renewed_thumbprint | 選填 | string | 如果訂單是續訂的,請輸入之前訂單的主要憑證的 SHA-1 指紋。 |
validity_years | 必填 | int |
憑證有效的年數。 可以用 validity_days 或 custom_expiration_date 取代。允許的值: 1 ,2
|
validity_days | 選填 | int |
憑證發行後的有效天數。 覆寫 validity_years
|
custom_expiration_date | 選填 | string |
憑證的自訂到期日。日期不可早於將來的 825 天。 覆寫 validity_days 和 validity_years 格式: yyyy-MM-dd
|
comments | 選填 | string | 與核准者的訂單有關的註解。 |
產品 | 選填 | 物件 | |
.. type_hint | 選填 | string |
說明正傳遞的產品類型。 允許的值: ov ,ev ,grid ,private
|
auto_renew | 選填 | int |
說明憑證是否應該自動續訂。 預設: 0 允許的值: 0 (停用),1 (啟用)
|
disable_renewal_notifications | 選填 | bool |
說明是否應停用續訂通知電郵。 預設: false
|
additional_emails | 選填 | array | 接收憑證通知電郵的其他電郵地址 (例如憑證發行、重複憑證、憑證續訂等)。 |
renewal_of_order_id | 選填 | int | 如果訂單是續訂的,請輸入之前訂單的 ID。 |
dcv_method | 必填 | string |
確認網域控制權時使用的 DCV 方法。 請參閱詞彙 — DCV 方法 |
skip_approval | 選填 | bool |
說明訂單是否應跳過核准步驟,並在完成時立刻提交進行驗證和發行。 預設: false
|
disable_ct | 選填 | bool |
說明是否應停用憑證的 CT 記錄。 必須啟用特定訂單的 CT 記錄或將忽略此事項。請參閱允許使用者將憑證保存在 CT 記錄外。 預設: false
|
organization | 必填 | object | 適用於組織詳細資料的容器。 |
.. id | 必填 | int | 與訂單關聯的組織的 ID。 |
container | 選填 | object | 視需要說明在其之下下訂單的容器。 |
.. id | 必填 | int | 容器 ID。 |
名稱 | 類型 | 說明 |
---|---|---|
id | int | 訂單 ID。 |
organization | object |
適用於新組織詳細資料的容器。 僅在建立有訂單的新組織時傳回。 |
.. id | int | 適用於新組織的組織 ID。 |
requests | array | 包含與要求有關的資訊。 |
.. id | int | 要求 ID。 |
.. status | string |
要求狀態。 可能的值: pending ,submitted ,approved ,rejected
|
certificate_id | int |
憑證 ID。 要求狀態是 approved 時傳回。
|