コンテンツにスキップ

メールの文面を部分更新する

PATCH
/api/v1/email/templates/{id}
curl --request PATCH \
--url https://app.goyoka.com/api/v1/email/templates/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0 \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "subject": "example", "body": "example", "enabled": true, "anchor": "example", "offset_minutes": 1, "send_at_local_time": "example", "target_service_ids": [ "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" ] }'

鍵やトークンの持ち主が今のこのお店のメンバーでないと409 EMAIL_OPERATION_BLOCKED(NOT_CURRENT_MEMBER)です。省略した欄は保存値を保持します(false・0・null・空配列は明示値として保存します)。省略補完した生値が保存値と完全一致するとき、空body⁠も含めて何も保存しません。有効にすると、次の掃引から、送る予定の時刻を過ぎてから7日(+時差の余裕)以内の予約にも送ります。それより古い予約には送りません。件名・本文・時刻・対象メニューの変更は、これから送るメールに反映されます。保存時には送信しません。ANNOUNCEMENT⁠は409 EMAIL_OPERATION_BLOCKED(details.blocks[].code:TEMPLATE_KIND_NOT_WRITABLE)です。同値・空PATCH⁠でも拒否します。掃引でしか送らない種別のanchor⁠を基準なし(BOOKED)へは戻せません。対象メニュー(target_service_ids)は個人セッション用だけ変更でき、空配列はそのお店の全メニューの予約が対象という意味です(target_service_ids⁠が空なら全メニュー)。イベント用・お問い合わせ用は送った値にかかわらず空配列へ揃えます。新しく加えた対象メニューID⁠だけ、アーカイブされていないこのお店のものか確認します(保存済みの削除済み・アーカイブ済みの参照はそのまま残せます)。同じID⁠の重複は422⁠です。任意の冪等キーを使えます。

kind・scope・booking_kind⁠は更新できません。

送信済みの予約と文面の組には再送せず、BOOKED⁠の文面は保存だけで過去の予約に送らず、以後の予約・承認・取消しなどの出来事で送ります。

応答前に不足する形態別の標準文面を補います。

保存競合は409 EMAIL_OPERATION_BLOCKED⁠で、details.blocks[].code⁠はCONCURRENT_UPDATE⁠です。

必要な範囲: email:write

id
必須
string 形式: uuid

ヘッダーのパラメータ

「ヘッダーのパラメータ」の節へ
Idempotency-Key
string

同じ内容の再送に同じ値を使います。異なる内容との再利用や処理中の再送は409 IDEMPOTENCY_KEY_REUSED⁠です。

メディアタイプapplication/json
object
subject
string
body
string
enabled
boolean
anchor
string
offset_minutes
number
send_at_local_time
string | null
target_service_ids
Array<string>
例自動生成
{
"subject": "example",
"body": "example",
"enabled": true,
"anchor": "example",
"offset_minutes": 1,
"send_at_local_time": "example",
"target_service_ids": [
"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"
]
}

メールの文面を部分更新する

メディアタイプapplication/json
object
data
必須
object
id
必須
string 形式: uuid
kind
必須
string
scope
必須
string
booking_kind
必須
string
subject
必須
string
body
必須
string
enabled
必須
boolean
anchor
必須
string
offset_minutes
必須
number
send_at_local_time
必須
string | null
target_service_ids
必須
Array<string>
is_custom
必須
boolean
sort_order
必須
number
tab
必須
string
取りうる値: session event inquiry
created_at
必須
string 形式: date-time
updated_at
必須
string 形式: date-time
例
{
"data": {
"tab": "session"
}
}

利用できないヘッダ

メディアタイプapplication/json
object
error
必須
object
code
必須
string
message
必須
string
details
object
任意のキー
追加の項目
request_id
必須
string
例自動生成
{
"error": {
"code": "example",
"message": "example",
"details": {
"additionalProperty": "example"
},
"request_id": "example"
}
}

鍵が無い・無効

メディアタイプapplication/json
object
error
必須
object
code
必須
string
message
必須
string
details
object
任意のキー
追加の項目
request_id
必須
string
例自動生成
{
"error": {
"code": "example",
"message": "example",
"details": {
"additionalProperty": "example"
},
"request_id": "example"
}
}

範囲不足

メディアタイプapplication/json
object
error
必須
object
code
必須
string
message
必須
string
details
object
任意のキー
追加の項目
request_id
必須
string
例自動生成
{
"error": {
"code": "example",
"message": "example",
"details": {
"additionalProperty": "example"
},
"request_id": "example"
}
}

見つからない

メディアタイプapplication/json
object
error
必須
object
code
必須
string
message
必須
string
details
object
任意のキー
追加の項目
request_id
必須
string
例自動生成
{
"error": {
"code": "example",
"message": "example",
"details": {
"additionalProperty": "example"
},
"request_id": "example"
}
}

予約・冪等キーの競合

メディアタイプapplication/json
object
error
必須
object
code
必須
string
message
必須
string
details
object
任意のキー
追加の項目
request_id
必須
string
例自動生成
{
"error": {
"code": "example",
"message": "example",
"details": {
"additionalProperty": "example"
},
"request_id": "example"
}
}

本文が1 MiB⁠を超えている

メディアタイプapplication/json
object
error
必須
object
code
必須
string
message
必須
string
details
object
任意のキー
追加の項目
request_id
必須
string
例自動生成
{
"error": {
"code": "example",
"message": "example",
"details": {
"additionalProperty": "example"
},
"request_id": "example"
}
}

入力の検証失敗

メディアタイプapplication/json
object
error
必須
object
code
必須
string
message
必須
string
details
object
任意のキー
追加の項目
request_id
必須
string
例自動生成
{
"error": {
"code": "example",
"message": "example",
"details": {
"additionalProperty": "example"
},
"request_id": "example"
}
}

回数の上限

メディアタイプapplication/json
object
error
必須
object
code
必須
string
message
必須
string
details
object
任意のキー
追加の項目
request_id
必須
string
例自動生成
{
"error": {
"code": "example",
"message": "example",
"details": {
"additionalProperty": "example"
},
"request_id": "example"
}
}
RateLimit-Limit
integer
>= 1

固定窓内の回数上限

RateLimit-Remaining
integer

固定窓内の残り回数

RateLimit-Reset
integer

窓終了までの秒数

Retry-After
integer
>= 1

再試行までの待機秒数

内部エラー

メディアタイプapplication/json
object
error
必須
object
code
必須
string
message
必須
string
details
object
任意のキー
追加の項目
request_id
必須
string
例自動生成
{
"error": {
"code": "example",
"message": "example",
"details": {
"additionalProperty": "example"
},
"request_id": "example"
}
}