Search code examples
apigoogle-apps-scriptlinechatbot

Line Bot; how to get user LINE ID?


i am trying to create line chatbot with several functions in it. One of the function need to know the user LINE ID (for example: ryan123) not user id (U858382312321123......). I am using google app script to create the line chatbot

is it possible to get user LINE ID using API? or is there any way to get this through line bot?


Solution

  • /profile/{userId} is the only* way you can get displayName

    *though there endpoints to get the profile with userId by further specifying the groupId or roomId

    In case your Messaging API bot is a verified or premium account, you can use a list of userId of followers at anytime with followers/ids

    Otherwise, you need to store them upon follow, messsage, etc. events