Available in: Enterprise Edition
Webhooks
Some Botfront features implies being able to communicate with the underlying IT infrastructure. Since every infrastructure is specific, some feature may require custom implementation to be available in Botfront. For example, restarting a Rasa instance, uploading medias, or deploying are very specific on how your IT infrastructure is organized.
Webhooks allow a deeper integration in your IT environment.
You can define webhooks at the platform lever in Admin -> Settings -> Webhooks.
Available webhooks
Restart Rasa
If set, this webhook will be invoked when changing endpoints
, credentials
, or performing any action requiring Rasa to restart.
Expected request body
{"projectId": string,"environment" : string,}
Expected response
This route does not return a an object. Botfront only expects the http status code.
Upload Image
Implementing this webhook enables image upload in Botfront.
Expected request body
{"projectId": string,"data": string, // image encoded in base64"mimeType": string,"language": string,"responseId": string // template name followed by unix timestamp, e.g. utter_get_started_1588107073256}
Expected response
{"uri": string // the publicly accessible URI for the asset just received}
Delete Image
The webhook will be invoked by Botfront when an image URL is no longer used in a response. The request will be sent whether or not the resource actually exists on the server.
Expected request body
{"projectId": string,"uri": string // the publicly accessible URI for the asset to be deleted}
Expected response
Botfront expects a 204 success response, and a 404 if ressource was not found. Any other response may signal an error to the user in the future.
Deploy
If set, and if your project has environments defined, the deploy menu will be available next to the training button.
When training, the webhook will be invoked with the development
environment.
When deploying, the webhook will be invoked with the production
environment.
Request
Botfront will send a request to the api with the following parameters.
{"projectId" : string,"namespace" : string,"environment" : string, // "development" or "production""data" : string, // base64 conversion of the model archive"mimeType" string,}
Expected response
Botfront except a 200 success response, other response are treated as errors. You can and a message property in the error response body that will be displayed to the user.
Report Crash
If set, browser crashes traces will sent to this webhook.
Request
Botfront will forward the following to the webhook:
{"version": string,"path": string,"error": string,"trace": string}
Expected response
Success-like responses (e.g. 200) are treated as successful.