Is there any way that we can retrieve User ID by Javascript?

Pre condition, Condition to reproduce

Issue happened while building Line Chatbot(built with Dialogflow)

Issue/ Error Message details

I want to know the way(the code) to get UserID by Javascript

  • 0
  • 1
  • 420
  • twitter facebook

Hi seoseo.

User ID is included in the common property in webhook event object. https://developers.line.biz/en/reference/messaging-api/#common-properties

like this

  "source": {
    "type": "user",
    "userId": "U4af4980629..."

So you can get User ID at every webhook.

if you can not do that, please let me know more details.

  • 0
Are you sure? question.vm