メインコンテンツまでスキップ

21.⾒積完了通知

指定したユーザーに「21.⾒積完了通知」の送信を行います。

POST /v2/notifications/templates/:template_identifier/estimation_completions

メッセージ送信は非同期で行われるため、この API ではメッセージ送信リクエストが正常に受け付けられたかどうかを返します。正常に受け付けた場合はメッセージ毎に一意のメッセージ ID を採番して返します。

メッセージ送信が完了しているかどうかは、そのメッセージ ID を用いて 通知メッセージ送信結果の取得 API で確認する必要があります。そのための URL をレスポンスに含めて返します。

認証 Provider / 通知メッセージ利用申請

通知メッセージを利用するためには、認証 Provider になったうえで LINE 社への申請が必要となります。

リクエストパラメータ

Path Parameters

パラメータ名必須説明
template_identifierstring通知メッセージのテンプレートを一意に表す識別子

Body Parameters

パラメータ名必須説明
providerstringプロバイダ名。line のみ対応
recipientrecipient objectメッセージ送信先
contentscontents objectメッセージ送信内容

Recipient オブジェクト

パラメータ名必須説明
typestringphone_number を指定
valuestringE.164 フォーマットに則ったハイフン無しの電話番号 (e.g. +819012345678)

Contents オブジェクト

パラメータ名必須説明
company_namestring企業名/サービス名
service_namestringサービス名/商品名
application_numberstring申込番号
estimate_amountstring見積金額
estimate_datestring見積日 (e.g. 2020-01-01)
estimate_timestring見積時刻 (e.g. 10:00)
detail_button_urlstring「詳細を確認する」ボタンの URL

エラーコード

エラー定義 参照。

レスポンス

成功時はステータスコード 202 Accepted とともに、作成した Notification リソースの JSON を返します。

パラメータ名Nullable説明
identifierstring通知メッセージを一意に表す識別子
status_urlstring通知メッセージの配信状況を確認する URL
レスポンス例
{
"identifier": "6fb75cc14b7ba0e58b9ee97926433ed7b90d1f2b",
"status_url": "https://msgapi.socialplus.jp/v2/notifications/6fb75cc14b7ba0e58b9ee97926433ed7b90d1f2b"
}

実行サンプル

$ curl -L -X POST 'https://msgapi.socialplus.jp/v2/notifications/templates/{Template identifier}/estimation_completions' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'X-API-Key: {API Key}' \
--data-raw '{
"provider": "line",
"recipient": {
"type": "phone_number",
"value": "{E.164 Phone Number}"
},
"contents": {
"company_name": "株式会社ソーシャルPLUS",
"service_name": "ソーシャルPLUS",
"application_number": "1234567890",
"estimate_amount": "12,345円",
"estimate_date": "2020-01-01",
"estimate_time": "10:00",
"detail_button_url": "https://example.com"
}
}'