无法将 webhook 设置为 viber bot

问题描述

我在将 webhook 设置到我的 viber 机器人时遇到了一些麻烦。每次我想设置我的 url viber api 时都会返回错误。 所以我想在邮递员中使用它:

网址:https://chatapi.viber.com/pa/set_webhook

{
    "url": "https://gutapi.ml/api/viber/post","event_types":[
      "conversation_started"
   ]
}

当我使用下面的代码时,viber api 返回此结果:

{
    "status": 1,"chat_hostname": "SN-CHAT-06_"
}

我的 url 有效并且我有 ssl 证书,但它仍然不起作用。希望你能帮我

解决方法

您在任何发布请求上都遇到 Http 错误:“500(内部服务器错误)”。所以问题在你这边:)

尝试使用 Postman 使用以下有效负载将 POST 请求发送到 https://gutapi.ml/api/viber/post(您的服务器)并查看您的日志。

ArrayList<Person101> personsArrayList;

还可以查看Viber API documentation了解更多详情: