使用此端點編輯訂單的自訂欄位值。如需有關自訂欄位的詳細資料,包括中繼資料 ID,請參閱列出自訂欄位端點。
當值的資料類型與自訂欄位允許的資料類型不相符時,傳回 invalid_custom_field_value
。
curl -X POST \
'https://www.digicert.com/services/v2/order/certificate/{{order_id}}/custom-field' \
-H 'Content-Type: application/json' \
-H 'X-DC-DEVKEY: {{api_key}}' \
-d '{
"metadata_id": 276,
"value": "New value"
}'
import requests
url = "https://www.digicert.com/services/v2/order/certificate/{{order_id}}/custom-field"
payload = "{\n \"metadata_id\": 276,\n \"value\": \"New value\"\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/{{order_id}}/custom-field"
payload := strings.NewReader("{\n \"metadata_id\": 276,\n \"value\": \"New value\"\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/{{order_id}}/custom-field',
headers:
{ 'Content-Type': 'application/json',
'X-DC-DEVKEY': '{{api_key}}' },
body: { metadata_id: 276, value: 'New value' },
json: true };
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
// empty
名稱 | 必填/選填 | 類型 | 說明 |
---|---|---|---|
metadata_id | 必填 | int | 指定要更新的自訂欄位的中繼資料 ID。 |
value | 必填 | string | 自訂欄位的新值。 |