JSONデータを利用することで、様々な形式のメッセージを配信できます。データの生成にはLINE社が提供する「LINE Bot Designer」というツールが便利です。
必要項目を設定後、ツール右下に生成されるJSONデータをコピーして、HubSpotのワークフローアクションに貼り付けてご利用ください。
下記は各種メッセージのJSONデータのサンプルです。
1. スタンプ
{
"type": "sticker",
"packageId": "1",
"stickerId": "2"
}
「packageId」と「stickerId」の詳細については、こちらのPDFファイルをご参照ください。
2. 画像
{
"type": "image",
"originalContentUrl": "",
"previewImageUrl": "https://littlehelp.co.jp/images/hero.jpg"
}
3. 動画
{
"type": "video",
"originalContentUrl": "https://storage.googleapis.com/littlehelp-app-storage/lineapp.mp4",
"previewImageUrl": "https://storage.googleapis.com/littlehelp-app-storage/lineapp.png"
}
4. 位置情報
{
"type": "location",
"title": "my location",
"address": "2-21-1, Shibuya, Shibuya Ku, Tokyo To, 150-0002, Japan",
"latitude": 35.65910807942215,
"longitude": 139.70372892916203
}
5. ボタンテンプレート
{
"type": "template",
"altText": "This is a buttons template",
"template": {
"type": "buttons",
"thumbnailImageUrl": "https://littlehelp.co.jp/images/hero.jpg",
"imageAspectRatio": "rectangle",
"imageSize": "cover",
"imageBackgroundColor": "#FFFFFF",
"title": "Little Help Agency LLC",
"text": "HubSpot LINE Integration",
"defaultAction": {
"type": "uri",
"label": "View detail",
"uri": "https://littlehelp.co.jp/line/"
},
"actions": [
{
"type": "uri",
"label": "View detail",
"uri": "https://littlehelp.co.jp/line/"
},
{
"type": "postback",
"label": "Free Trial",
"data": "action=trial&itemid=123"
},
{
"type": "postback",
"label": "Contact Us",
"data": "action=contact&itemid=123"
}
]
}
}
6. 確認テンプレート
{
"type": "template",
"altText": "this is a confirm template",
"template": {
"type": "confirm",
"text": "Are you sure?",
"actions": [
{
"type": "message",
"label": "Yes",
"text": "yes"
},
{
"type": "message",
"label": "No",
"text": "no"
}
]
}
}
7. カルーセルテンプレート
{
"type": "template",
"altText": "this is a carousel template",
"template": {
"type": "carousel",
"columns": [
{
"thumbnailImageUrl": "https://littlehelp.co.jp/images/hero.jpg",
"imageBackgroundColor": "#FFFFFF",
"title": "Little Help Agency LLC",
"text": "HubSpot LINE Integration",
"defaultAction": {
"type": "uri",
"label": "View detail",
"uri": "https://littlehelp.co.jp/line/"
},
"actions": [
{
"type": "uri",
"label": "View detail",
"uri": "https://littlehelp.co.jp/line/"
},
{
"type": "postback",
"label": "Free Trial",
"data": "action=trial&itemid=123"
},
{
"type": "postback",
"label": "Contact Us",
"data": "action=contact&itemid=123"
}
]
},
{
"thumbnailImageUrl": "https://littlehelp.co.jp/images/hero.jpg",
"imageBackgroundColor": "#FFFFFF",
"title": "Little Help Agency LLC",
"text": "HubSpot LINE Integration",
"defaultAction": {
"type": "uri",
"label": "View detail",
"uri": "https://littlehelp.co.jp/line/"
},
"actions": [
{
"type": "uri",
"label": "View detail",
"uri": "https://littlehelp.co.jp/line/"
},
{
"type": "postback",
"label": "Free Trial",
"data": "action=trial&itemid=123"
},
{
"type": "postback",
"label": "Contact Us",
"data": "action=contact&itemid=123"
}
]
}
],
"imageAspectRatio": "rectangle",
"imageSize": "cover"
}
}
JSONデータの仕様はLINE Messaging APIに準じます。詳細についてはLINE Developersのドキュメントをご参照ください。
Next: 流入経路分析について