このエンドポイントを使用して、オーダーのカスタムフィールド値を編集します。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 | カスタムフィールドの新しい値 |