Notification > Notification Hub > API v1.0使用ガイド > メッセージ
リクエスト本文にメッセージ内容を入力し、メッセージを送信リクエストします。
各メッセージチャンネルにメッセージを送信するためには、各メッセージチャンネルの送信情報が登録されている必要があります。送信情報の登録は、Notification Hubコンソール > 送信情報タブで行うことができます。メッセージチャンネルの発信情報の詳細な説明は、Notification > Notification Hub > 利用ポリシー及び事前設定案内で確認できます。
リクエスト
POST /message/v1.0/{messageChannel}/free-form-messages/{messagePurpose}
X-NC-APP-KEY: {appKey}
X-NHN-Authorization: Bearer {accessToken}
リクエストパラメータ
名前 | 区分 | タイプ | 必須 | 説明 |
---|---|---|---|---|
appKey | Header | String | Y | アプリキー |
accessToken | Header | String | Y | 認証トークン |
messageChannel | Path | String | Y | メッセージチャンネル SMS, RCS, ALIMTALK, FRIENDTALK, EMAIL, PUSH |
messagePurpose | Path | String | Y | メッセージ目的 NORMAL, AD, AUTH |
共通リクエスト本文
メッセージチャンネルによるリクエスト本文の詳細は、下記のメッセージチャンネル別詳細リクエスト本文をご確認ください。
{
"statsKeyId": "統計_ID",
"scheduledDateTime": "2024-10-29T00:06:29+09:00",
"confirmBeforeSend": false,
"sender": {
"...": "メッセージ_チャンネルに_よって_異なる_形式"
},
"recipients": [
{
"contacts": [
{
"contactType": "PHONE_NUMBER",
"contact": "01012345678"
}
]
}
],
"content": {
"...": "メッセージ_チャンネルに_よって_異なる_形式"
}
}
名前 | タイプ | 必須 | 説明 |
---|---|---|---|
statsKeyId | String | N | 統計キーID |
scheduledDateTime | DateTime(ISO 8601) | N | 予約送信日時(例:2024-10-29T06:29:00+09:00) |
confirmBeforeSend | Boolean | N | 送信前に確認するかどうか(デフォルト値false) |
sender | Object | Y/N | 発信者、プッシュ以外のメッセージチャンネルは必須 |
recipients | Object Array | Y | 受信者配列 |
recipients[].contacts | Object Array | Y | 受信者の連絡先配列 |
recipients[].contacts[].contactType | String | Y | 連絡先タイプ PHONE_NUMBER, EMAIL_ADDRESS, TOKEN_FCM, TOKEN_APNS, TOKEN_ADM, TOKEN_APNS_SANDBOX, TOKEN_APNS_VOIP, TOKEN_APNS_VOIP_SANDBOX |
recipients[].contacts[].contact | String | Y | 連絡先 |
content | Object | Y | メッセージ内容 |
メッセージチャンネル | フィールド | 説明 |
---|---|---|
SMS | sender.senderPhoneNumber | 発信者番号 |
RCS | sender.brandId | ブランドID |
RCS | sender.chatbotId | チャットルームID |
sender.senderMailAddress | 発信者メールアドレス | |
ALIMTALK, FRIENDTALK | sender.senderKey | 発信キー |
ALIMTALK | sender.senderProfileType | 発信プロフィールタイプ GROUP, NORMAL |
レスポンス本文
{
"header": {
"isSuccessful": true,
"resultCode": 0,
"resultMessage": "SUCCESS"
},
"messageId": "メッセージ_ID"
}
名前 | タイプ | 説明 |
---|---|---|
header.isSuccessful | Boolean | APIリクエスト成否 |
header.resultCode | Integer | 結果コード |
header.resultMessage | String | 結果メッセージ |
messageId | String | リクエスト成功したメッセージID |
リクエスト例
### 専門メッセージ送信
POST {{endpoint}}/message/v1.0/PUSH/free-form-messages/{messagePurpose}
Content-Type: application/json
X-NC-APP-KEY: {{appKey}}
X-NHN-Authorization: {{authorizationToken}}
{
"confirmBeforeSend": false,
"sender": {
"senderPhoneNumber": "01012341234"
},
"recipients": [
{
"contacts": [
{
"contactType": "PHONE_NUMBER",
"contact": "01012345678"
}
]
}
],
"content": {
"messageType": "SMS",
"body": "こんにちは。 NHN Cloudの新規商品Notification Hubがリリースされました。"
}
}
curl -X POST "${ENDPOINT}/message/v1.0/PUSH/free-form-messages/${MESSAGE_PURPOSE}" \
-H "Content-Type: application/json" \
-H "X-NC-APP-KEY: ${APP_KEY}" \
-H "X-NHN-Authorization: ${ACCESS_TOKEN}" \
-d '{
"confirmBeforeSend": false,
"sender": {
"senderPhoneNumber": "01012341234"
},
"recipients": [
{
"contacts": [
{
"contactType": "PHONE_NUMBER",
"contact": "01012345678"
}
]
}
],
"content": {
"messageType": "SMS",
"body": "こんにちは。 NHN Cloudの新規商品Notification Hubがリリースされました。"
}
}'
{
"statsKeyId": "統計_キー_ID",
"scheduledDateTime": "2024-10-24T06:29:00+09:00",
"confirmBeforeSend": false,
"sender": {
"senderPhoneNumber": "01012341234"
},
"recipients": [
{
"contacts": [
{
"contactType": "PHONE_NUMBER",
"contact": "01012345678"
}
]
}
],
"content": {
"messageType": "MMS",
"title": "[NHN Cloud Notification Hub]告知事項",
"body": "こんにちは。 NHN Cloud Notification Hubです。",
"attachmentIds": [
"添付_ファイル_ID"
]
}
}
名前 | タイプ | 必須 | 説明 |
---|---|---|---|
sender | Object | Y | 発信者、プッシュ以外のメッセージチャンネルは必須 |
sender.senderPhoneNumber | String | N | 発信者番号 |
content | Object | Y | メッセージ内容 |
content.messageType | String | Y | メッセージタイプ SMS(短文), LMS(長文), MMS(メディア長文) |
content.title | String | Y | タイトル |
content.body | String | Y | 内容 |
content.attachmentIds | String Array | N | 添付ファイルID |
{
"statsKeyId": "統計_キー_ID",
"scheduledDateTime": "2024-10-24T06:29:00+09:00",
"confirmBeforeSend": false,
"sender": {
"brandId": "ブランド_ID",
"chatbotId": "チャットルーム_ID"
},
"recipients": [
{
"contacts": [
{
"contactType": "PHONE_NUMBER",
"contact": "01012345678"
}
]
}
],
"content": {
"messageType": "SMS",
"unsubscribePhoneNumber": "08012341234",
"title": "[NHN Cloud Notification Hub]告知事項",
"body": "こんにちは。 NHN Cloud Notification Hubです。",
"mmsType": "HORIZONTAL",
"messagebaseId": "44o4SUjpqnjDuUcH+uHvPg==",
"cards": [
{
"title":"testTitle",
"description":"testBody",
"media":"fileId",
"buttons" : [
{
"buttonType" : "URL",
"buttonJson" : "{ \"action\": { \"urlAction\":{\"openUrl\":{\"url\":\"http://www.test.com\"} },\"displayText\":\"Webサイトへ移動\"}}"
},
{
"buttonType" : "URL",
"buttonJson" : "{ \"action\": { \"urlAction\":{\"openUrl\":{\"url\":\"http://www.test.com\"} },\"displayText\":\"Webサイトへ移動\"}}"
}
]
}
],
"buttons": [
{
"buttonType": "URL",
"buttonJson": "{ \"action\": { \"urlAction\":{\"openUrl\":{\"url\":\"http://www.test.com\"} },\"displayText\":\"Webサイトへ移動\"}}"
}
]
}
}
名前 | タイプ | 必須 | 説明 |
---|---|---|---|
sender | Object | Y | 発信者 |
sender.brandId | Object | N | ブランドID |
sender.chatbotId | Object | N | チャットルームID |
content | Object | Y | メッセージ内容 |
content.messageType | String | Y | RCS内のメッセージタイプ、 SMS, LMS, MMS, RCS_TEMPLATE |
content.unsubscribePhoneNumber | String | Y | 080受信拒否番号、送信目的が広告の場合は必須 |
content.title | Object | Y | タイトル |
content.Object | Y | 内容 | |
content.mmsType | Object | N | MMSタイプ、メッセージタイプがMMSの場合必須、 HORIZONTAL(水平), VERTICAL(垂直), CAROUSEL_MEDIUM(カルーセル中央), CAROUSEL_SMALL(カルーセル小さく) |
content.messagebaseId | Object | N | メッセージタイプがRCS_TEMPLATEの場合必須、 RCS Biz Centerに登録されたテンプレートID |
content.cards | Object Array | Y | カード |
content.cards[].title | String | Y | タイトル |
content.cards[].description | String | Y | 内容 |
content.cards[].media | String | Y | 添付ファイルID |
content.cards[].buttons | Object Array | Y | ボタン |
content.cards[].button.buttonType | String | Y | ボタンタイプ COMPOSE(チャットルームを開く), CLIPBOARD(コピーする), DIALER(電話をかける), MAP_SHOW(マップを表示する), MAP_QUERY(マップを検索する), MAP_SHARE(現在地を共有する), URL(URL接続する), CALENDAR(予定を登録する) |
content.cards[].button.buttonJson | String | Y | ボタンJson,ボタンタイプに合ったフォーマット確認 |
content.buttons | Object Array | Y | ボタン |
content.buttons[].buttonType | String | Y | ボタンタイプ COMPOSE(チャットルームを開く), CLIPBOARD(コピーする), DIALER(電話をかける), MAP_SHOW(マップを表示する), MAP_QUERY(マップを検索する), MAP_SHARE(現在地を共有する), URL(URL接続する), CALENDAR(予定を登録する) |
content.buttons[].buttonJson | String | Y | ボタンJSON形式の文字列 |
content.attachmentIds | String Array | N | 添付ファイルID配列 |
{
"statsKeyId": "統計_キー_ID",
"scheduledDateTime": "2024-10-24T06:29:00+09:00",
"confirmBeforeSend": false,
"sender": {
"senderKey": "発信プロフィール_発信キー"
},
"recipients": [
{
"contacts": [
{
"contactType": "PHONE_NUMBER",
"contact": "01012345678"
}
]
}
],
"content": {
"messageType": "TEXT",
"content": "送信_内容",
"buttons": [
{
"type": "WL",
"name": "ボタン_名前",
"linkMo": "モバイル_リンク",
"linkPc": "PC_リンク",
"schemeIos": "iOS_アプリ_リンク",
"schemeAndroid": "Android_アプリ_リンク",
"bizFormKey": "ビズフォーム_キー"
}
],
"coupon": {
"title": "クーポン_タイトル",
"description": "クーポン_詳細_説明",
"linkMo": "モバイル_リンク",
"linkPc": "PC_リンク",
"schemeIos": "iOS_アプリ_リンク",
"schemeAndroid": "Android_アプリ_リンク"
}
}
}
名前 | タイプ | 必須 | 説明 |
---|---|---|---|
sender | Object | Y | 発信者 |
sender.senderKey | Object | Y | 発信プロフィール_発信キー |
content | Object | Y | メッセージ内容 |
content.messageType | String | Y | メッセージタイプ |
content.content | String | Y | 内容 |
content.buttons | Object Array | N | ボタン |
content.buttons[].type | String | Y | ボタンタイプ WL(Webリンク), AL(アプリリンク), BK(Botキーワード), MD(メッセージ伝達), BF(ビジネスフォーム) |
content.buttons[].name | String | Y | ボタン名 |
content.buttons[].linkMo | String | N | リンクモバイル、ボタンタイプがWLの場合は必須 |
content.buttons[].linkPc | String | N | リンクPC |
content.buttons[].schemeIos | String | N | iOSアプリリンク |
content.buttons[].schemeAndroid | String | N | Androidアプリリンク |
content.buttons[].bizFormKey | String | N | ビズフォームキー、ボタンタイプがBFの場合は必須 |
content.coupon | Object | N | クーポン |
content.coupon.title | String | Y | タイトル、場合5つの形式に制限 "${数字}KRW割引クーポン"数字は1以上99,999,999以下 "${数字}%割引クーポン"数字は1以上100以下 "送料割引クーポン" "${7文字以内}無料クーポン" "${7文字以内} UPクーポン" |
content.coupon.description | String | Y | クーポン詳細説明(一般テキスト、画像型、カルーセルフィード型最大12文字 / ワイド画像型、ワイドアイテムリスト型最大18文字) |
content.coupon.linkMo | String | N | リンクモバイル |
content.coupon.linkPc | String | N | リンクPC |
content.coupon.schemeIos | String | N | iOSアプリリンク |
content.coupon.schemeAndroid | String | N | Androidアプリリンク |
{
"statsKeyId": "統計_キー_ID",
"scheduledDateTime": "2024-10-24T06:29:00+09:00",
"confirmBeforeSend": false,
"sender": {
"senderKey": "発信プロフィール_発信キー"
},
"recipients": [
{
"contacts": [
{
"contactType": "PHONE_NUMBER",
"contact": "01012345678"
}
]
}
],
"content": {
"messageType": "WIDE_IMAGE",
"content": "送信_内容",
"attachmentId": "添付_ファイル_ID",
"imageLink": "画像_リンク_URL",
"buttons": [
{
"type": "WL",
"name": "ボタン_名前",
"linkMo": "モバイル_リンク",
"linkPc": "PC_リンク",
"schemeIos": "iOS_アプリ_リンク",
"schemeAndroid": "Android_アプリ_リンク",
"bizFormKey": "ビズフォーム_キー"
}
],
"coupon": {
"title": "クーポン_タイトル",
"description": "クーポン_詳細_説明",
"linkMo": "モバイル_リンク",
"linkPc": "PC_リンク",
"schemeIos": "iOS_アプリ_リンク",
"schemeAndroid": "Android_アプリ_リンク"
}
}
}
名前 | タイプ | 必須 | 説明 |
---|---|---|---|
sender | Object | Y | 発信者 |
sender.senderKey | Object | Y | 発信プロフィール_発信キー |
content | Object | Y | メッセージ内容 |
content.messageType | String | Y | メッセージタイプ |
content.content | String | Y | 内容 |
content.attachmentId | String | Y | 添付ファイルID |
content.imageLink | String | N | 画像リンク |
content.buttons | Object Array | N | ボタン |
content.buttons[].type | String | Y | ボタンタイプ WL(Webリンク), AL(アプリリンク), BK(Botキーワード), MD(メッセージ伝達), BF(ビジネスフォーム) |
content.buttons[].name | String | Y | ボタン名 |
content.buttons[].linkMo | String | N | リンクモバイル、ボタンタイプがWLの場合は必須 |
content.buttons[].linkPc | String | N | リンクPC |
content.buttons[].schemeIos | String | N | iOSアプリリンク |
content.buttons[].schemeAndroid | String | N | Androidアプリリンク |
content.buttons[].bizFormKey | String | N | ビズフォームキー、ボタンタイプがBFの場合必須 |
content.coupon | Object | N | クーポン |
content.coupon.title | String | Y | タイトル、場合5つの形式に制限 "${数字}KRW割引クーポン"数字は1以上99,999,999以下 "${数字}%割引クーポン"数字は1以上100以下 "送料割引クーポン" "${7文字以内}無料クーポン" "${7文字以内} UPクーポン" |
content.coupon.description | String | Y | クーポン詳細説明(一般テキスト、画像型、カルーセルフィード型最大12文字 / ワイド画像型、ワイドアイテムリスト型最大18文字) |
content.coupon.linkMo | String | N | リンクモバイル |
content.coupon.linkPc | String | N | リンクPC |
content.coupon.schemeIos | String | N | iOSアプリリンク |
content.coupon.schemeAndroid | String | N | Androidアプリリンク |
{
"statsKeyId": "統計_キー_ID",
"scheduledDateTime": "2024-10-24T06:29:00+09:00",
"confirmBeforeSend": false,
"sender": {
"senderKey": "発信プロフィール_発信キー"
},
"recipients": [
{
"contacts": [
{
"contactType": "PHONE_NUMBER",
"contact": "01012345678"
}
]
}
],
"content": {
"messageType": "WIDE_ITEMLIST",
"buttons": [
{
"type": "WL",
"name": "ボタン_名前",
"linkMo": "モバイル_リンク",
"linkPc": "PC_リンク",
"schemeIos": "iOS_アプリ_リンク",
"schemeAndroid": "Android_アプリ_リンク",
"bizFormKey": "ビズフォーム_キー"
}
],
"header": "ヘッダ",
"item": {
"list": [{
"title": "アイテム_タイトル",
"attachmentId": "添付_ファイル_ID",
"linkMo": "モバイル_リンク",
"linkPc": "PC_リンク",
"schemeIos": "iOS_アプリ_リンク",
"schemeAndroid": "Android_アプリ_リンク"
},
{
"title": "アイテム_タイトル",
"attachmentId": "添付_ファイル_ID",
"linkMo": "モバイル_リンク",
"linkPc": "PC_リンク",
"schemeIos": "iOS_アプリ_リンク",
"schemeAndroid": "Android_アプリ_リンク"
},
{
"title": "アイテム_タイトル",
"attachmentId": "添付_ファイル_ID",
"linkMo": "モバイル_リンク",
"linkPc": "PC_リンク",
"schemeIos": "iOS_アプリ_リンク",
"schemeAndroid": "Android_アプリ_リンク"
}
]
},
"coupon": {
"title": "クーポン_タイトル",
"description": "クーポン_詳細_説明",
"linkMo": "モバイル_リンク",
"linkPc": "PC_リンク",
"schemeIos": "iOS_アプリ_リンク",
"schemeAndroid": "Android_アプリ_リンク"
}
}
}
名前 | タイプ | 必須 | 説明 |
---|---|---|---|
sender | Object | Y | 発信者 |
sender.senderKey | Object | Y | 発信プロフィール_発信キー |
content | Object | Y | メッセージ内容 |
content.messageType | String | Y | メッセージタイプ |
content.buttons | Object Array | N | ボタン |
content.buttons[].type | String | Y | ボタンタイプ WL(Webリンク), AL(アプリリンク), BK(Botキーワード), MD(メッセージ伝達), BF(ビジネスフォーム) |
content.buttons[].name | String | Y | ボタン名 |
content.buttons[].linkMo | String | N | リンクモバイル、ボタンタイプがWLの場合は必須 |
content.buttons[].linkPc | String | N | リンクPC |
content.buttons[].schemeIos | String | N | iOSアプリリンク |
content.buttons[].schemeAndroid | String | N | Androidアプリリンク |
content.buttons[].bizFormKey | String | N | ビズフォームキー、ボタンタイプがBFの場合必須 |
content.header | String | Y | ヘッダ |
content.item | Object | Y | ワイドアイテム |
content.item.list | Object Array | Y | ワイドアイテムリスト(最小3個、最大4個) |
content.item.list[].title | String | Y | アイテムタイトル(最初のアイテムの場合は最大25文字、 2~4番目のアイテムの場合は最大30文字) |
content.item.list[].attachmentId | String | Y | 添付ファイルID |
content.item.list[].linkMo | String | Y | モバイルWebリンク |
content.item.list[].linkPc | String | Y | PC Webリンク |
content.item.list[].schemeIos | String | Y | iOSアプリリンク |
content.item.list[].schemeAndroid | String | Y | Androidアプリリンク |
content.coupon | Object | N | クーポン |
content.coupon.title | String | Y | タイトル、場合5つの形式に制限 "${数字}KRW割引クーポン"数字は1以上99,999,999以下 "${数字}%割引クーポン"数字は1以上100以下 "送料割引クーポン" "${7文字以内}無料クーポン" "${7文字以内} UPクーポン" |
content.coupon.description | String | Y | クーポン詳細説明(一般テキスト、画像型、カルーセルフィード型最大12文字 / ワイド画像型、ワイドアイテムリスト型最大18文字) |
content.coupon.linkMo | String | N | リンクモバイル |
content.coupon.linkPc | String | N | リンクPC |
content.coupon.schemeIos | String | N | iOSアプリリンク |
content.coupon.schemeAndroid | String | N | Androidアプリリンク |
{
"statsKeyId": "統計_キー_ID",
"scheduledDateTime": "2024-10-24T06:29:00+09:00",
"confirmBeforeSend": false,
"sender": {
"senderKey": "発信プロフィール_発信キー"
},
"recipients": [
{
"contacts": [
{
"contactType": "PHONE_NUMBER",
"contact": "01012345678"
}
]
}
],
"content": {
"messageType": "CAROUSEL_FEED",
"carousel": {
"list": [
{
"header": "カルーセル_アイテム_タイトル",
"message": "カルーセル_アイテム_メッセージ",
"attachment": {
"buttons": [
{
"type": "WL",
"name": "ボタン_名前",
"linkMo": "モバイル_リンク",
"linkPc": "PC_リンク",
"schemeIos": "iOS_アプリ_リンク",
"schemeAndroid": "Android_アプリ_リンク"
}
],
"image": {
"attachmentId": "添付_ファイル_ID",
"imageLink": "画像_リンク_URL"
},
"coupon": {
"title": "クーポン_タイトル",
"description": "クーポン_詳細_説明",
"linkMo": "モバイル_リンク",
"linkPc": "PC_リンク",
"schemeIos": "iOS_アプリ_リンク",
"schemeAndroid": "Android_アプリ_リンク"
}
}
},
{
"header": "カルーセル_アイテム_タイトル",
"message": "カルーセル_アイテム_メッセージ",
"attachment": {
"buttons": [
{
"type": "WL",
"name": "ボタン_名前",
"linkMo": "モバイル_リンク",
"linkPc": "PC_リンク",
"schemeIos": "iOS_アプリ_リンク",
"schemeAndroid": "Android_アプリ_リンク"
}
],
"image": {
"attachmentId": "添付_ファイル_ID",
"imageLink": "画像_リンク_URL"
},
"coupon": {
"title": "クーポン_タイトル",
"description": "クーポン_詳細_説明",
"linkMo": "モバイル_リンク",
"linkPc": "PC_リンク",
"schemeIos": "iOS_アプリ_リンク",
"schemeAndroid": "Android_アプリ_リンク"
}
}
}
],
"tail": {
"linkMo": "モバイル_リンク",
"linkPc": "PC_リンク",
"schemeAndroid": "Android_アプリ_リンク",
"schemeIos": "iOS_アプリ_リンク"
}
}
}
}
名前 | タイプ | 必須 | 説明 |
---|---|---|---|
sender | Object | Y | 発信者 |
sender.senderKey | Object | Y | 発信プロフィール_発信キー |
content | Object | Y | メッセージ内容 |
content.messageType | String | Y | メッセージタイプ |
content.carousel | Object | Y | カルーセル |
content.carousel.list | Object Array | Y | カルーセルリスト(最小2個、最大10個) |
content.carousel.list[].header | String | Y | カルーセルアイテムタイトル(最大20文字)、カルーセルフィード型でのみ使用可能 |
content.carousel.list[].message | String | Y | カルーセルアイテムメッセージ(最大180文字)、カルーセルフィード型でのみ使用可能 |
content.carousel.list[].attachment | Object | N | カルーセルアイテム画像、ボタン情報 |
content.carousel.list[].attachment.buttons | Object Array | N | ボタンリスト(最大2個) |
content.carousel.list[].attachment.buttons[].type | String | Y | ボタンタイプ WL(Webリンク), AL(アプリリンク), BK(Botキーワード), MD(メッセージ伝達), BF(ビジネスフォーム) |
content.carousel.list[].attachment.buttons[].name | String | Y | ボタン名 |
content.carousel.list[].attachment.buttons[].linkMo | String | N | リンクモバイル、ボタンタイプがWLの場合は必須 |
content.carousel.list[].attachment.buttons[].linkPc | String | N | リンクPC |
content.carousel.list[].attachment.buttons[].schemeIos | String | N | iOSアプリリンク |
content.carousel.list[].attachment.buttons[].schemeAndroid | String | N | Androidアプリリンク |
content.carousel.list[].attachment.image | Object | Y | カルーセル画像 |
content.carousel.list[].attachment.image.attachmentId | String | Y | 添付ファイルid |
content.carousel.list[].attachment.image.imageLink | String | N | 画像リンクURL |
content.carousel.list[].attachment.coupon | Object | N | クーポン |
content.carousel.list[].attachment.coupon.title | String | Y | タイトル、場合5つの形式に制限 "${数字}KRW割引クーポン"数字は1以上99,999,999以下 "${数字}%割引クーポン"数字は1以上100以下 "送料割引クーポン" "${7文字以内}無料クーポン" "${7文字以内} UPクーポン" |
content.carousel.list[].attachment.coupon.description | String | Y | クーポン詳細説明(一般テキスト、画像型、カルーセルフィード型最大12文字 / ワイド画像型、ワイドアイテムリスト型最大18文字) |
content.carousel.list[].attachment.coupon.linkMo | String | N | リンクモバイル |
content.carousel.list[].attachment.coupon.linkPc | String | N | リンクPC |
content.carousel.list[].attachment.coupon.schemeIos | String | N | iOSアプリリンク |
content.carousel.list[].attachment.coupon.schemeAndroid | String | N | Androidアプリリンク |
content.carousel.tail | Object | N | カルーセル詳細表示ボタン情報 |
content.carousel.tail.linkMo | String | Y | モバイルWebリンク |
content.carousel.tail.linkPc | String | N | モバイルWebリンク |
content.carousel.tail.schemeIos | String | N | モバイルWebリンク |
content.carousel.tail.schemeAndroid | String | N | モバイルWebリンク |
{
"sender": {
"senderMailAddress": "sender@example.com"
},
"recipients": [
{
"contacts": [
{
"contactType": "EMAIL_ADDRESS",
"contact": "recipient@example.com"
}
]
}
],
"content": {
"title": "[NHN Cloud Notification Hub]告知事項",
"body": "こんにちは。 NHN Cloud Notification Hubです。",
"attachmentIds": [
"添付_ファイル_ID"
]
}
}
名前 | タイプ | 必須 | 説明 |
---|---|---|---|
sender | Object | N | 発信者、プッシュ以外のメッセージチャンネルは必須 |
sender.senderMailAddress | Object | N | 発信者メールアドレス |
content | Object | Y | メッセージ内容 |
content.title | Object | Y | タイトル |
content.Object | Y | 内容 | |
content.attachmentIds | String Array | N | 添付ファイルID |
{
"statsId": "統計_ID",
"scheduledDateTime": "2024-10-29T06:29:00+09:00",
"confirmBeforeSend": false,
"recipients": [
{
"contacts": [
{
"contactType": "TOKEN_FCM",
"contact": "トークン"
}
]
}
],
"content": {
"unsubscribePhoneNumber": "1234-1234",
"unsubscribeGuide": "設定 > メニュー",
"style": {
"useHtmlStyle": true
},
"title" : "<b>NHN Cloud </b> Notification",
"body" : "<b>リリースイベント</b> <i>告知事項確認</i>",
"richMessage" : {
"buttons" : [{
"name" : "ボタン名",
"submitName": "送信ボタン名",
"buttonType" : "REPLY",
"link" : "myapp://product_detail?product_id=1234",
"hint" : "ボタンに関するヒント"
}
],
"media" : {
"source" : "URL",
"mediaType" : "IMAGE",
"expandable" : true
},
"androidMedia": {
"source" : "URL",
"mediaType" : "IMAGE",
"expandable" : true
},
"iosMedia": {
"source" : "URL",
"mediaType" : "IMAGE",
"expandable" : true
},
"largeIcon" : {
"source" : "URL"
},
"group" : {
"key" : "グループのキー",
"description" : "グループについての説明"
}
},
"customKey" : "customValue"
}
}
名前 | タイプ | 必須 | 説明 |
---|---|---|---|
content | Object | Y | メッセージ内容 |
content.unsubscribePhoneNumber | String | プッシュメッセージ受信拒否のための代表番号 | |
content.unsubscribeGuide | String | プッシュメッセージ受信拒否のための案内 | |
content.title | String | Y | タイトル |
content.String | Y | 内容 | |
content.style.useHtmlStyle | Boolean | Y | HTMLスタイル使用(Androidでのみ可能) |
content.richMessage | Object | リッチメッセージ | |
content.richMessage | Object | N | リッチメッセージ使用時に必要 |
content.richMessage.buttons | Object Array | N | リッチメッセージに追加されるボタン、最大3個まで可能 |
content.richMessage.button.name | String | ボタン名 | |
content.richMessage.button.buttonType | String | ボタンタイプ、 REPLY, DEEP_LINK, OPEN_APP, OPEN_URL, DISMISS | |
content.richMessage.button.link | String | ボタンを押した時に接続されるリンク | |
content.richMessage.button.hint | String | ボタンについてのヒント | |
content.richMessage.media | Object | N | リッチメッセージに追加されるメディア |
content.richMessage.media.source | String | メディアの位置のアドレス、 URL, LOCAL_RESOURCE可能 | |
content.richMessage.media.mediaType | String | N | メディアのタイプ、 IMAGE, GIF, VEDIO, AUDIO. AndroidでのみIMAGEのみサポート |
content.richMessage.media.expandable | Boolean | N | Androidでメディアをクリックした時に展開機能を使用するかどうか |
content.richMessage.androidMedia | Object | N | Android端末で使用されるメディア。形式はmediaと同じ。 |
content.richMessage.iosMedia | Object | N | iOS端末使用されるメディア。形式はmediaと同じ。 |
content.richMessage.largeIcon | Object | N | リッチメッセージに追加される大きなアイコン、 Androidでのみサポート |
content.richMessage.largeIcon.source | String | Y | メディアの位置のアドレス |
content.richMessage.group | Object | N | 複数のメッセージをグループ単位でまとめる機能、Androidのみサポート |
content.richMessage.group.key | String | Y | グループのキー |
content.richMessage.group.description | String | Y | グループについての説明 |
content.customKey | Object Array or String Array | N | ユーザー定義キーと値 |
リクエスト
POST /message/v1.0/{messageChannel}/template-messages/{messagePurpose}
X-NC-APP-KEY: {appKey}
X-NHN-Authorization: Bearer {accessToken}
リクエストパラメータ
名前 | 区分 | タイプ | 必須 | 説明 |
---|---|---|---|---|
appKey | Header | String | Y | アプリキー |
accessToken | Header | String | Y | 認証トークン |
messageChannel | Path | String | Y | メッセージチャンネル SMS, RCS, ALIMTALK, FRIENDTALK, EMAIL, PUSH |
messagePurpose | Path | String | Y | メッセージ目的 NORMAL, AD, AUTH |
リクエスト本文
{
"statsKeyId": "統計_ID",
"scheduledDateTime": "2024-10-29T00:06:29+09:00",
"confirmBeforeSend": false,
"templateId": "テンプレート_ID",
"templateParameters": {
"key1": "value1",
"key2": "value2",
"key3": {
"key4": "value4",
"key5": "value5"
}
},
"recipients": [
{
"contacts": [
{
"contactType": "PHONE_NUMBER",
"contact": "01012345678"
}
],
"templateParameters": {
"key3": {
"key4": "value4",
"key5": "value5"
},
"key6": "value6"
}
}
]
}
名前 | タイプ | 必須 | 説明 |
---|---|---|---|
statsKeyId | String | N | 統計キーID |
scheduledDateTime | DateTime(ISO 8601) | N | 予約送信日時(例:2024-10-29T06:29:00+09:00) |
confirmBeforeSend | Boolean | N | 送信前確認を行うかどうか(デフォルト値false) |
templateId | String | Y | テンプレートID |
templateParameters | Object | N | テンプレートパラメータ |
recipients | Object Array | Y | 受信者配列 |
recipients[].contacts | Object Array | Y | 受信者の連絡先配列 |
recipients[].contacts[].contactType | String | Y | 連絡先タイプ |
recipients[].contacts[].contact | String | Y | 連絡先 |
recipients[].templateParameters | Object | N | テンプレートパラメータ |
レスポンス本文
{
"header": {
"isSuccessful": true,
"resultCode": 0,
"resultMessage": "SUCCESS"
},
"messageId": "メッセージ_ID"
}
リクエスト例
### テンプレートメッセージ送信
POST {{endpoint}}/message/v1.0/SMS/template-messages/NORMAL
Content-Type: application/json
X-NC-APP-KEY: {{appKey}}
X-NHN-Authorization: {{authorizationToken}}
{
"statsKeyId": "統計_ID",
"scheduledDateTime": "2024-10-29T00:06:29+09:00",
"confirmBeforeSend": false,
"templateId": "テンプレート_ID",
"templateParameters": {
"key1": "value1",
"key2": "value2",
"key3": {
"key4": "value4",
"key5": "value5"
}
},
"recipients": [
{
"contacts": [
{
"contactType": "PHONE_NUMBER",
"contact": "01012345678"
}
],
"templateParameters": {
"key3": {
"key4": "value4",
"key5": "value5"
},
"key6": "value6"
}
}
]
}
curl -X POST "${ENDPOINT}/message/v1.0/SMS/template-messages/${MESSAGE_PURPOSE}" \
-H "Content-Type: application/json" \
-H "X-NC-APP-KEY: ${APP_KEY}" \
-H "X-NHN-Authorization: ${ACCESS_TOKEN}" \
-d '{
"statsKeyId": "統計_ID",
"scheduledDateTime": "2024-10-29T00:06:29+09:00",
"confirmBeforeSend": false,
"templateId": "テンプレート_ID",
"templateParameters": {
"key1": "value1",
"key2": "value2",
"key3": {
"key4": "value4",
"key5": "value5"
}
},
"recipients": [
{
"contacts": [
{
"contactType": "PHONE_NUMBER",
"contact": "01012345678"
}
],
"templateParameters": {
"key3": {
"key4": "value4",
"key5": "value5"
},
"key6": "value6"
}
}
]
}'
リクエスト
POST /message/v1.0/flow-messages/{messagePurpose}
X-NC-APP-KEY: {appKey}
X-NHN-Authorization: Bearer {accessToken}
リクエストパラメータ
名前 | 区分 | タイプ | 必須 | 説明 |
---|---|---|---|---|
appKey | Header | String | Y | アプリキー |
accessToken | Header | String | Y | 認証トークン |
messagePurpose | Path | String | Y | メッセージ目的 NORMAL, AD, AUTH |
リクエスト本文
{
"statsKeyId": "統計_ID",
"scheduledDateTime": "2024-10-29T00:06:29+09:00",
"confirmBeforeSend": false,
"flowId": "テンプレート_ID",
"templateParameters": {
"key1": "value1",
"key2": "value2",
"key3": {
"key4": "value4",
"key5": "value5"
}
},
"recipients": [
{
"contacts": [
{
"contactType": "TOKEN_FCM",
"contact": "token"
},
{
"contactType": "EMAIL_ADDRESS",
"contact": "recipient@example.com"
},
{
"contactType": "PHONE_NUMBER",
"contact": "01012345679"
}
],
"templateParameters": {
"key3": {
"key4": "value4",
"key5": "value5"
},
"key6": "value6"
}
}
]
}
名前 | タイプ | 必須 | 説明 |
---|---|---|---|
statsKeyId | String | N | 統計キーID |
scheduledDateTime | DateTime(ISO 8601) | N | 予約送信日時(例:2024-10-29T06:29:00+09:00) |
confirmBeforeSend | Boolean | N | 送信前確認を行うかどうか(デフォルト値false) |
flowId | String | Y | テンプレートID |
templateParameters | Object | N | メッセージ共通テンプレートパラメータ |
recipients | Object Array | Y | 受信者配列 |
recipients[].contacts | Object Array | Y | 受信者の連絡先配列 |
recipients[].contacts[].contactType | String | Y | 連絡先タイプ |
recipients[].contacts[].contact | String | Y | 連絡先 |
recipients[].templateParameters | Object | N | 受信者別テンプレートパラメータ |
レスポンス本文
{
"header": {
"isSuccessful": true,
"resultCode": 0,
"resultMessage": "SUCCESS"
},
"messageId": "メッセージ_ID"
}
リクエスト例
### フローメッセージ送信
POST {{endpoint}}/message/v1.0/flow-messages/{{messagePurpose}}
Content-Type: application/json
X-NC-APP-KEY: {{appKey}}
X-NHN-Authorization: {{authorizationToken}}
{
"statsKeyId": "統計_ID",
"scheduledDateTime": "2024-10-29T00:06:29+09:00",
"confirmBeforeSend": false,
"flowId": "テンプレート_ID",
"templateParameters": {
"key1": "value1",
"key2": "value2",
"key3": {
"key4": "value4",
"key5": "value5"
}
},
"recipients": [
{
"contacts": [
{
"contactType": "TOKEN_FCM",
"contact": "token"
},
{
"contactType": "EMAIL_ADDRESS",
"contact": "recipient@example.com"
}
],
"templateParameters": {
"key3": {
"key4": "value4",
"key5": "value5"
},
"key6": "value6"
}
}
]
}
curl -X POST "${ENDPOINT}/message/v1.0/flow-messages/${MESSAGE_PURPOSE}" \
-H "Content-Type: application/json" \
-H "X-NC-APP-KEY: ${APP_KEY}" \
-H "X-NHN-Authorization: ${ACCESS_TOKEN}" \
-d '{
"statsKeyId": "統計_ID",
"scheduledDateTime": "2024-10-29T00:06:29+09:00",
"confirmBeforeSend": false,
"flowId": "テンプレート_ID",
"templateParameters": {
"key1": "value1",
"key2": "value2",
"key3": {
"key4": "value4",
"key5": "value5"
}
},
"recipients": [
{
"contacts": [
{
"contactType": "TOKEN_FCM",
"contact": "token"
},
{
"contactType": "EMAIL_ADDRESS",
"contact": "recipient@example.com"
}
],
"templateParameters": {
"key3": {
"key4": "value4",
"key5": "value5"
},
"key6": "value6"
}
}
]
}'
送信前の予約メッセージ、承認後の送信メッセージの送信要求をキャンセルします。リクエストキャンセルされたメッセージは、連絡先別受信結果照会で照会できます。
リクエスト
POST /message/v1.0/messages/{messageId}/do-cancel
X-NC-APP-KEY: {appKey}
X-NHN-Authorization: Bearer {accessToken}
リクエストパラメータ
名前 | 区分 | タイプ | 必須 | 説明 |
---|---|---|---|---|
appKey | Header | String | Y | アプリキー |
accessToken | Header | String | Y | 認証トークン |
messageId | Path | String | Y | メッセージID |
リクエスト本文
このAPIはリクエスト本文を要求しません。
レスポンス本文
{
"header": {
"isSuccessful": true,
"resultCode": 0,
"resultMessage": "SUCCESS"
}
}
リクエスト例
### メッセージリクエストキャンセル
POST {{endpoint}}/message/v1.0/messages/{{messageId}}/do-cancel
Content-Type: application/json
X-NC-APP-KEY: {{appKey}}
X-NHN-Authorization: {{accessToken}}
curl -X POST "${ENDPOINT}/message/v1.0/messages/${MESSAGE_ID}/do-cancel" \
-H "Content-Type: application/json" \
-H "X-NC-APP-KEY: ${APP_KEY}" \
-H "X-NHN-Authorization: ${ACCESS_TOKEN}"