コンテンツを更新する(PATCH /contents/{id})
基本情報
ベータ版機能について
この機能はベータ版での提供となっており、動作が不安定な場合があります。
また、今後互換性を保たない変更が加わる可能性があります。
あらかじめご了承いただいた上でのご利用をお願いいたします。
指定IDのコンテンツの指定フィールドを更新します。
PATCH/v1/contents/{content_id}
https://cms-api.nilto.com/v1/contents/{content_id}
リクエストパラメータ
X-NILTO-API-KEYX-NILTO-API-KEY | NILTO APIキー。 スペース設定のAPIキー画面で取得することができます。 |
content_id必須 | integer |
model必須 | string |
published | boolean |
space | string |
ft_format | string |
fields | object (contentRequest) |
fields[{lang_key}] | any |
リクエスト例
curl -X PATCH "https://cms-api.nilto.com/v1/contents/1234567890?model=news&published=false" \
-H "X-NILTO-API-KEY: 0000000000000000000000" \
-H "Content-Type: application/json" \
-d '{
"fields": {
"singleline_field": "このフィールドだけを更新します",
"datetime_field": "2023-03-07T19:12:46Z"
}
}'{
"fields": {
"singleline_field": "foobar",
"datetime_field": "2023-01-23T04:50:00Z"
},
"fields[en]": {
"singleline_field": "foobar"
},
"fields[zh-CN]": {
"singleline_field": "foobar"
}
}レスポンス
200 OK
id | integer コンテンツID |
400 Bad Request
status | string |
code | string |
401 Unauthorized
status | string |
code | string |
402 Payment Required
status | string |
code | string |
403 Forbidden
status | string |
code | string |
404 Not Found
status | string |
code | string |
429 Too Many Requests
status | string |
code | string |
message | string |
500 Internal Server Error
status | string |
code | string |
レスポンス例
{
"id": 1234567890
}{
"status": "400",
"code": "BadRequest"
}{
"status": "401",
"code": "Unauthorized"
}{
"status": "402",
"code": "Payment Required"
}{
"status": "403",
"code": "Forbidden"
}{
"status": "404",
"code": "Not Found"
}{
"status": "429",
"code": "Too Many Requests",
"message": "Expected available in 58 seconds."
}{
"status": "500",
"code": "Internal Server Error"
}