我如何获得订阅我的公共viber帐户的订户的信息?

时间:2019-09-18 09:46:53

标签: java json rest api viber

我想要订阅者的用户ID。在文档https://developers.viber.com/docs/api/rest-bot-api/#subscribed中,它仅显示如下回调:

{
   "event":"conversation_started",
   "timestamp":1457764197627,
   "message_token":4912661846655238145,
   "type":"open",
   "context":"context information",
   "user":{
      "id":"01234567890A=",
      "name":"John McClane",
      "avatar":"http://avatar.example.com",
      "country":"UK",
      "language":"en",
      "api_version":1
   },
   "subscribed":false
}

1 个答案:

答案 0 :(得分:0)

您提供的文档链接是有关某些特定用户订阅时出现的Webhook事件的信息。

您可以做的是使用Get Account Info端点获取有关您的订户的信息。它的响应包含subscribers_countmembers(具有以下字段的列表:idnameavatarrole)。

PS 。您唯一需要检查的是公共帐户订阅者是否也是聊天机器人订阅者。