Callbacks
Informed Design provides callbacks that hook into different stages of the API request lifecycle. These callbacks serve two main purposes:
- Providing real-time feedback to users about request status and progress
- Enabling additional processing of returned data
Callbacks can be registered for two key workflow stages:
- Output Generation
- Output Upload
Two callback types are supported:
OnProgress Callback
Delivers real-time status updates as your request progresses through the system. This callback is triggered whenever the status changes during either Output Generation or Output Upload.
OnComplete Callback
Notifies when an asynchronous request has finished, eliminating the need to poll for status updates. The response includes the output ID and current status for each output generated.
Example
The structure of both onProgress and onComplete callbacks remains consistent whether used for Output Generation or Output Upload. The primary distinction lies in the possible status values returned for each workflow stage.
When specifying verbs for onComplete``** and ``onProgress you may use any one of the following values:
postputpatchget
curl -X POST \
'https://developer.api.autodesk.com/industrialized-construction/informed-design/v1/outputs?accessType=<ACCESS_TYPE>&accessId=<PROJECT_ID>|<FOLDER_URN>' \
-H 'Authorization: Bearer <YOUR_ACCESS_TOKEN>' \
-H 'Content-Type: application/json' \
-d '{
"variantId": "d53feca7-c65b-4741-aca7-827a42d686bf",
/* Additional configuration properties */
"onComplete": {
"verb": "post",
"url": "https://oncomplete.free.beeceptor.com"
},
"onProgress": {
"verb": "post",
"url": "https://onprogress.free.beeceptor.com"
},
/* Additional configuration properties */
}'
The following is the structure of the callback body for both the onProgress and onComplete callbacks:
{
"outputs": [
{
"outputId": "d53feca7-c65b-4741-aca7-827a42d686bf",
"status": "...",
/* Additional output properties */
},
/* Additional output properties */
]
}
For output generation, the value of status can be one of the following:
- onComplete: OUTPUT_SUCCESS, OUTPUT_FAILED
- onProgress: OUTPUT_SUCCESS, OUTPUT_FAILED, OUTPUT_PENDING
For output upload, the value of status can be one of the following:
- onComplete: UPLOAD_SUCCESS, UPLOAD_FAILED
- onProgress: UPLOAD_SUCCESS, UPLOAD_FAILED, UPLOAD_PENDING