Webhook callback
Info
Documents are currently in BETA and the API interface may change when this is deemed necessary.
Once configured during creation it is possible to receive an callback once the document goes through a state change. In order to process the results automatically in your backend.
The following state changes result in the webhook being called:
- Create
- Update
- Delete
Callback URL's
The callback URL has must meet the following conditions, besides being a valid URL in order to be usable for the callback functionality:
- Must be HTTPS
- Cannot be
localhost
orlocaldomain
- Cannot be an IP address (IPv4 and/or IPv6)
- Must be resolvable for the API (eg. no internal/local domains)
Callback message
The Scriptix API will always call the configurated HTTPS endpoint with the following message. It is possible to configure custom headers (eg. an authentication key) but the headers stated below are not overridable.
Callback headers
The following headers are always present
Header | Value | Description |
---|---|---|
X-Scriptix-Session | ${transcriptSessionId} |
The Scriptix Transcript Session ID |
X-Scriptix-Document | ${documentId} |
The document ID |
Content-Type | application/json |
The content type of the callback message |
Callback body
The callback body is a JSON body containing an object with the following keys
Key | Type | Description |
---|---|---|
sessionId |
string |
The Scriptix Transcript Session ID |
documentId |
string |
The document ID |
Automatic retry
The HTTP webhook endpoint on the customer side should always respond with an 2XX
status code within
20 seconds or the request will be marked as failed. When this happens an automatic retry will
start after a certain period. The following intervals have been configured.
Delay | Time after document state change |
---|---|
00:00 |
Immediate after state change |
01:00 |
1 minute after state change |
02:00 |
3 minutes after state change |
05:00 |
8 minutes after state change |
15:00 |
23 minutes after state change |
30:00 |
53 minutes after state change |
If a callback could not be performed succesfully after the final delay, the callback is abandoned and no further notification is send about the state change.
Example flows
The following flows are examples on how this functionality could be leveraged in order to enhance the capabilities of your own product.
Document creation
Document can be created by eather the API directly or through our portal in the role of an Editor1. In either case the flow consists of a few steps:
- API (Optional) If configured in the TranscriptSession a webhook callback can be made to the customer in order to notify a TranscriptSession is done.
- API The customer creates the document through the API.
- API The Scriptix API will reply with the metadata of the created document.
- Portal The editor creates a document from an existing TranscriptSession through the Scriptix portal.
- Portal The Scriptix API creates the document and redirects the customer to the newly created document.
- When configured a webhook callback is performed to the provided endpoint with a DocumentStatusChange object.
- The customer retrieves the latest version of the document.
- The Scriptix API provides the latest version of the document.
Document update
- API A customer implementation updates the document through the API.
- API The Scriptix API will respond with the latest document metadata.
- Portal The editor updates the document through the Scriptix Portal.
- When configured a webhook callback is performed to the provided endpoint with a DocumentStatusChange object.
- The customer retrieves the latest version of the document.
- The Scriptix API provides the latest version of the document in the requested format.
Document removal
- API A customer implementation removes the document through the API.
- API The Scriptix API will respond with an empty HTTP No Content response.
- Portal The editor removes the document through the Scriptix Portal and gets redirected to the TranscriptSession page.
- When configured a webhook callback is performed to the provided endpoint with a DocumentStatusChange object.
- The customer tries to retrieves the latest version of the document.
- The Scriptix API responds with a 404 Not Found, indicating that the document is not longer available.
-
A person whom edits a transcript or caption file through the Scriptix API portal. Or equivalent functionality provided through a third party platform. ↩