Message Failed

This event notifies you of a message that could not be sent using phone number. This happens mostly when there is no Viber account associated with a given phone number.

{
  "event": "message_failed",
  "timestamp" : "2017-12-29T17:26:17.331Z",
  "data" : {
    "channel": {
      "id": "6456078759331238786",
      "type": "viber_business_messages"
    },
    "contact": {
      "id": "6456078781510718339",
      "phone_number": "15558576309"
    },
    "message": {
      "id": "6456078996108088196"
    },
    "error": {
      "code": 3,
      "message": "Cannot find Viber user for given phone number."
    }
  }
}
ParameterTypeDescription
data.channelobjectChannel where the data.contact resides in.
data.contactobjectContact to whom the message was sent but not delivered.
data.messageobjectMessages which was sent, will contain only message.id.
data.error.codenumberError code, see errors below.
data.error.messagestringDetail message of an error, see errors below.

Errors

Error CodeReason
1Error while processing the request.
2Sending messages to this user is blocked.
3Cannot find user for given phone number.
4Message failed to be delivered within specified time (see channel property default_message_ttl).