PushMessage: property 'to' is invalid
I tried to send a push message but I always get the following response:
{ "message": "The property, 'to', in the request body is invalid (line: -, column: -)" }
Where could I find the right ID of the receiver and what format should have it(String or Array)? Or is it only available for a paid account and not an developer trial?
Hi, @dratha
You can get it from webhook request.
For example, events[].source.userId.
{
"events": [
{
"replyToken": "nHuyWiB7yP5Zw52FIkcQobQuGDXCTA",
"type": "message",
"timestamp": 1462629479859,
"source": {
"type": "user",
"userId": "U206d25c2ea6bd87c17655609a1c37cb8"
},
"message": {
"id": "325708",
"type": "text",
"text": "Hello, world"
}
}
]
}
Ok. Thanks.
You can see here whether you can use the push API. Thanks. :)
https://admin-official.line.me/

I want to push message but i dont know user id of my followers. how can i get user id of followers/friends so i can send them push message? thank you
@ffebri You can get user friends userId from webhook. When user add bot as friends and talk to your bot, you can get webhooks, which are delivered to your registered url. Except webhooks, currently you cannot get any userIds.
@krrrr38
do you mean i only can get friends userId if they talk to my bot? what if they never talk and just read my message?
@ffebri Generally you collect userIds when adding bot as a friend. If already friends, require user actions such as talk to your bot. User actions contains, follow as a friend, invite to group, talk and so on, which doesn't include read message.
@krrrr38 ok, thanks a lot.
can we get the user ID by entering the user by himself?
Because I don't predict the user list, the system needs to send line messages related to the user who registers the system with the line user ID.