Q&A

Message API event source problem?

I created a Bot and joined a group. I'm trying to catch message event and get "source.userId" ,but there is one group member cannot get the "source.userId". The event from him was like:

{"type":"message","replyToken":"be68361fb1a4424b81030e2cf6d66985","source":{"groupId":"Cbdc4fa7e7d5bxxxxx73a085864ee0","type":"group"}

the other members can work like :

{"type":"message","replyToken":"2430d4bd1ea1446dab6e1a09a14b741a","source":{"userId":"Ub5836c877dbc3xxxx92b5da5034dc4aa","type":"user"}

why only the message event from the member would be from group?

  • 0
  • 2
  • 1541
  • twitter facebook

Thanks for Shoya Shiraki. But the member is a normal Android user. I found the member's account is foreign account. It seems to be the main cause.

  • 0

It seems to be related to "User consent"

userId ID of the source user. Only included in message events. Only users of LINE for iOS and LINE for Android are included in userId.

https://developers.line.biz/en/reference/messaging-api/#source-group https://developers.line.biz/en/docs/messaging-api/user-consent/

  • 1
Are you sure? question.vm