Using Webio's webhook you can configure your endpoints within your Webio organisation to post or retrieve data.
Identifying the request is from us
To identify the request as originating from Webio, first use the API to generate a JWT token.
To generate the JWT header you need the api key from your Webio organisation, your secret key (this must be a minimum of 32 bytes) and your organisation ID. Once created this will then be included with every event until the a new JWT token is generated.
Once generated all requests from Webio will then contain this token within the header x-webio-token. This enables you to verify that the request is originating from Webio.
The Webio token can be regenerated as often as you wish and the latest token will be provided within a request.
Subscribing to events
Webio has 5 standard webhooks available for you to subscribe to, 4 post requests and 1 get request.
Inbound messages - Message details and content of an inbound message received to a channel id assigned to your organisation.
Message Send - A message status update to confirm a message state has moved from pending to sent.
Delivery Report - A message status update to confirm a message state has moved from a sent status to an outcome status.
Payment - Confirmation details of any successful payment made via WebioPay will be returned to your endpoint.
Get request - this requests information from your system to update values used within the bot webhook fields <<>>
Custom Value Request - Webio will send a request to the endpoint configured within your organisation. The request will contain the Customer ID (this is a null value for inbound initiated conversations), the channel id (e.g. phone number) and the field names of the parameters requested.
This can be used to update message content with real time information such as current balance requests, or provide data that the bot can use for identification and verification.
This is made up of:
https://sampleendpoint - the webhook endpoint configured in your Webio Organisation
?customerUID=123456&outboundChannelAddress=44777777777 - information from the contact
¶m1=balance¶m2=ID - fields configured as webhook values <<>> within the bot steps
The parameters requested will be dependent on what is configured at that stage within the bot. This may just be one parameter or multiple parameters.
Currently for inbound communications only the outboundChannelAddress will be populated. The customerUID field will be null.
The field names are configured within the bot and identified with <<fieldname>>, these can be set by Webio users in the bot steps. They can be set either as the value to gather in a listening step or as a comparison condition within a logical branch step.
To see how to add your webhooks into your Webio organisation check out the article Adding Webhooks