Line Webhook
消息回调服务
对提供的webhook地址,进行Line业务相关的推送信息(目前支持推送上行消息)
上行消息
下发Viber消息后,对消息状态进行回执推送
- URL:dr_webhook
- Method:POST
- Content-Type:application/json
回执参数
body 参数:
参数名 |
类型 |
说明 |
destination |
String |
商户channelId |
events |
array[event JsonObject] |
事件信息 |
event json obj:
参数名 |
类型 |
说明 |
type |
String |
message |
webhookEventId |
String |
webhook事件ID |
timestamp |
Number |
发送时间 |
replyToken |
String |
引用消息的回复token |
mode |
String |
模式 |
message |
JsonObject |
消息详情 |
source |
JsonObject |
来源 |
deliveryContext |
JsonObject |
是否是重新传递的事件 |
参数名 |
类型 |
说明 |
type |
String |
消息类型(text、image、video、audio、file、location) |
id |
String |
消息id |
quoteToken |
String |
会话信息 |
text |
String |
文本消息内容(type为text时有值) |
duration |
Long |
语音播放时长,单位毫秒(type为audio时有值) |
title |
String |
位置名称(type为location时有值) |
address |
String |
位置详情(type为location时有值) |
latitude |
String |
经度(type为location时有值) |
longitude |
String |
纬度(type为location时有值) |
contentProvider |
JsonObject |
图像文件的提供者 |
- contentProvider object参数:
参数名 |
类型 |
说明 |
type |
String |
(取值:line ->图像由 LINE 用户发送) |
参数名 |
类型 |
说明 |
type |
String |
消息来源(user、multi-person chat、group chat) |
userId |
String |
用户id |
- deliveryContext object参数:
参数名 |
类型 |
说明 |
isRedelivery |
boolean |
(true:重新传递 webhook 事件; false:发送第一个 webhook 事件) |
回执示例
text
{
"destination": "U44d64355f3d939f4db74649d82dxxxx",
"events": [
{
"type": "message",
"message": {
"type": "text",
"id": "509243235328065891",
"quoteToken": "d0fu6utH1aziqG3BKtINCjcfF7I5ZFYBYK65sYQnKLrrUvFlP_A_sIU8kfiDFWT7e4PJtevdnaoOchJyX7S1QaHGpHcB51u-Gb7YBP8O-ekuzcyHsIMdG8W-gbbIownHWhEL5OS51peQi-4cdmZ8pQ",
"text": "测试"
},
"webhookEventId": "01HYFM66MC7K0N6QAX1ZVDXD13",
"deliveryContext": {
"isRedelivery": false
},
"timestamp": 1716363925648,
"source": {
"type": "user",
"userId": "Ua56c6dca206ce700a3f1b0e49dxxxxx"
},
"replyToken": "c384d55299124bf4b504e3004fd6bcf0",
"mode": "active"
}
]
}
image
{
"destination": "U44d64355f3d939f4dbxxxxx",
"events": [
{
"type": "message",
"message": {
"type": "image",
"id": "509379024964550871",
"quoteToken": "OGU3EwklDuRXKXD8iZtgGHRAvQH24v6JNlJbUaIBlZkejT_Echq9q8n2nGPtajVXvi-z4OFbcCsjJF7cq0CivFvoEJmND1LthUOK-UVYJacQMnpiNBzhuKmk8S7C5BPOtI7A8tOvJHogWfYF1Avl-Q",
"contentProvider": {
"type": "line"
}
},
"webhookEventId": "01HYJ1C80FKV2297RK0JZHG497",
"deliveryContext": {
"isRedelivery": false
},
"timestamp": 1716444864021,
"source": {
"type": "user",
"userId": "Ua56c6dca206ce700a3f1bxxxx"
},
"replyToken": "ebf2fd90eb1d44b0aa228c09f2e2a9ae",
"mode": "active"
}
]
}
video
{
"destination": "U44d64355f3d939f4db746xxxx",
"events": [
{
"type": "message",
"message": {
"type": "video",
"id": "509379284860141587",
"quoteToken": "yzG4cpaZqwNDuyDsjHkss8ZYx1ES0RPFZFWdpMGPi3e4g0M6V_ttAk5mSueDIkqq5VtL0j_wIaJVR9QJr230nmkzE-7HP4FR224Uz5gnvkUqdk_bieN5WQiP0DX8_pMcnac-txXZmD6XODt7jcVl-A",
"duration": "10735",
"contentProvider": {
"type": "line"
}
},
"webhookEventId": "01HYJ1H5444AHFT914RBA6F5N2",
"deliveryContext": {
"isRedelivery": false
},
"timestamp": 1716445024988,
"source": {
"type": "user",
"userId": "Ua56c6dca206ce700a3f1b0xxxx"
},
"replyToken": "d636a28b24fb41709301bed06a78641e",
"mode": "active"
}
]
}
audio
{
"destination": "U44d64355f3d939f4db74649d82dxxxx",
"events": [
{
"type": "message",
"message": {
"type": "audio",
"id": "507219478615425234",
"duration": 60476,
"contentProvider": {
"type": "line"
}
},
"webhookEventId": "01HXBNT9593S29CQ8AEFZ4AFQH",
"deliveryContext": {
"isRedelivery": false
},
"timestamp": 1715157672843,
"source": {
"type": "user",
"userId": "U727e5ee2977bc7c75dad300cxxxxx"
},
"replyToken": "3fbcb0d115334482a45174b48dd1174d",
"mode": "active"
}
]
}
file
{
"destination": "U44d64355f3d939f4db746xxxx",
"events": [
{
"type": "message",
"message": {
"type": "file",
"id": "509379284860141587",
"quoteToken": "yzG4cpaZqwNDuyDsjHkss8ZYx1ES0RPFZFWdpMGPi3e4g0M6V_ttAk5mSueDIkqq5VtL0j_wIaJVR9QJr230nmkzE-7HP4FR224Uz5gnvkUqdk_bieN5WQiP0DX8_pMcnac-txXZmD6XODt7jcVl-A",
"contentProvider": {
"type": "line"
}
},
"webhookEventId": "01HYJ1H5444AHFT914RBA6F5N2",
"deliveryContext": {
"isRedelivery": false
},
"timestamp": 1716445024988,
"source": {
"type": "user",
"userId": "Ua56c6dca206ce700a3f1b0e4xxxx"
},
"replyToken": "d636a28b24fb41709301bed06a78641e",
"mode": "active"
}
]
}
location
{
"destination": "U44d64355f3d939f4db74649d8xxxxx",
"events": [
{
"type": "message",
"message": {
"type": "location",
"id": "509378006452535330",
"title": "xxx",
"address": "xxxxxxxx",
"latitude": 22.581143,
"longitude": 113.954891
},
"webhookEventId": "01HYJ0SNFXS2SB98NYVT028S1Z",
"deliveryContext": {
"isRedelivery": false
},
"timestamp": 1716444255360,
"source": {
"type": "user",
"userId": "Ua56c6dca206ce700a3f1b0xxxxx"
},
"replyToken": "098edadbd3dc41369bab4be7486debe5",
"mode": "active"
}
]
}