Q&A

How to get userId for Messaging API?

I have create "Trial Plan" for Messaging API, and i make friend with some acount Line (A, B...). I want to push message to A. But i have not userId of A. How to get userId of A? What API to do this?

  • 0
  • 2
  • 6554
  • twitter facebook

I am also encountering the same problem. How can I get JSON like @Shoya Shiraki's answer?

  • 0

You can get userId when make friend with bot or send some message to bot. https://developers.line.biz/en/reference/messaging-api/#follow-event

{
  "replyToken": "nHuyWiB7yP5Zw52FIkcQobQuGDXCTA",
  "type": "follow",
  "timestamp": 1462629479859,
  "source": {
    "type": "user",
    "userId": "U4af4980629..."
  }
}
  • 0

関連する質問

    関連する質問はありません

本当によろしいですか? question.vm