Search code examples
webpostmanwebhooksviber-apiviber-bot

Can't set webhook to viber bot


I have some troubles with setting webhook to my viber bot. Every time I wanna set my url viber api returns error. So I am trying to use this in postman:

Url: https://chatapi.viber.com/pa/set_webhook

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

When I use code below, viber api returns this result:

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

My url is valid and I have ssl sertificate, but it still does not work. Hope you'll help me


Solution

  • You have Http error: "500 (Internal Server Error)" on any post request. So problem is on your side :)

    Try to send POST request to https://gutapi.ml/api/viber/post (your server) with following payload using Postman and look to your logs.

    {
       "status":0,
       "status_message":"ok",
       "event_types":[
          "conversation_started"
       ]
    }
    

    Also have a look to Viber API documentation for more details: