Webhooks
When you successfully submit a POST job request to APS, the Model Derivative service initiates a translation job. Depending on the complexity and size of the model, it may take a while for the job to finish. Rather than periodically check if the translation job is done, you can use a webhook to be notified when the job is done.
A webhook is a way for the server to send your app an HTTP POST request, when an event occurs. This eliminates the need for you to periodically check if an event you are interested in has occurred. Since webhooks can notify you of the occurrence of an event in near real-time, webhooks are preferred over polling.
Before you start using webhooks, you must register (or create) the webhook in APS. When you register a webhook, you have to provide the following information:
- The Service the webhook is created for.
- The URL to send the HTTP POST request to (The callback URL).
- Specify what event to monitor.
- Specify what resource to monitor (The scope).
For more information on creating/registering webhooks, see the Webhooks API documentation
Handling Callbacks
The HTTP POST request that APS sends your application contains a JSON payload. The payload can differ from event to event, and your application must handle the payload. The event documentation provides the schema of the payload as well as an example object. Use the links in the following table to access the event documentation.
System | Event | Description |
---|---|---|
derivative |
extraction.finished | When a job is completed. |
derivative |
extraction.updated | When a job is in progress. |
See the Webhooks How-to Guide for a walkthrough that explains how to create a Webhook for Model Derivative events.