Skip to main content

Webhook

The gateway sends a webhook to the address passed in the hook parameter of a send request. One webhook is sent per message, on every change of its status.

A message that the gateway refused to accept is reported by the same webhook with status: REJECTED and the reason in error. There is no separate payload for errors.

URI: https://api.interconnect.solutions/api/json.php

All requests to API are sent in JSON format using the POST method.

Header parameters

Requests must contain header Content-Type: application/json and X-Signature, otherwise, the request will be considered invalid even if it has valid JSON.

X-Signature

The X-Signature header is passed by concatenating a JSON string and an API-key.
Example: X-Signature: sha256(json_body + api_key)

Delivery

The webhook is sent once, without retries. Connection timeout — 5 seconds, total timeout — 5 seconds. Your server is expected to answer with code 200; the response body is ignored.

Request parameters

idstring
Unique message identifier in the client system
⚠️ Absent if none of the messages in the async packet had id
msg_idstring
Message identifier assigned by the gateway
⚠️ Absent if the message was rejected before it was created
typestring
Message type: sms, viber, voice, rcs
⚠️ Absent when the request was rejected and creates no message of its own (for example balance or hlr)
statusstring
Message status. List of values — Message statuses
A message rejected on acceptance gets the status REJECTED
successbooleanrequired
true if the message was delivered (DELIVERED, READ, REPLIED, PARTIALLY DELIVERED). false for any other status, including REJECTED on accept
errorstring
Reason why the message was rejected
⚠️ Present only together with status: REJECTED, when the message was rejected on acceptance
updatedstring
Date and time of the status change
Format: YYYY-MM-DDThh:mm:ss±hh:mm
replystring
The digit entered by the recipient (DTMF)
⚠️ Available only for type: voice, if dtmf was requested
durationnumber
Call duration in seconds
⚠️ Available only for type: voice
request_idstring
Asynchronous request identifier. Matches the request_id from the gateway response when sending via /v1/json
⚠️ Present only for messages sent via the
asynchronous API. If the packet has no id on any message, a single webhook with request_id is sent
replieslist[object]
List of replies to the message
⚠️ Available only in
Viber 2 Way
datetimestring
Date and time of receipt of the response
Format: YYYY-MM-DDThh:mm:ss±hh:mm
messagestring
Text of message
mediaobject
Object containing information about the media file attached to the message
urlstring
Link to media file
filenamestring
Media file name
filesizenumber
Media file size

Request example

{
"id": "100500",
"msg_id": "123456789",
"type": "viber",
"status": "READ",
"success": true,
"updated": "2024-01-31T12:34:00+02:00"
}

Response parameters

You will receive code 200 in response.

Response example

HTTP Status Code: 200
Content Type: JSON application/json

note

If the whole request is rejected — for example with Access denied — one webhook is sent per unique id. If no message in the packet has an id, a single webhook with request_id is sent to the first hook.