Line Messaging API + PHPでメッセージを送信する際の、送信先のユーザーID

プログラムで設定する送信先のユーザーIDは、各ユーザーが自分のスマホなどのLINE→プロフィールの「ID」に表示されるものとは違い、 半角英数字の乱数のような文字列ですが、このAPI用のユーザーIDを、開発者ではなく、APIでメッセージを受け取る各ユーザーが、自分で調べる方法があれば お知らせいただけますでしょうか。


  • 0
  • 1
  • 2208
  • twitter facebook

Let answer this one by one. 1. if there is a way for each user who receives the message in the API, not the developer, to find out the user ID for themselves? Ans: By the default, The user can't view their userId as LINE didn't provide any in-app tool to view it. But you as the developer, you can develop some function that show the userId to your user e.g (1. By using Messaging API - Make your webhook to send the reply message that contain userId when user typed with specific keyword) or (2. By using LIFF - Develop LIFF App to show the userId by using liff.getProfile().userId). Note: There is no API to convertion between the LINE ID found on LINE App and userId used in LINE API the only way to get it is to retrieve it from user.

2 I found a description that sending to the group is not possible Ans: Actually, You can either send Reply or Push message to the group by using the replyToken to send the reply message and use the groupId to send the push message to the specific group.

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