Exchange Notifications and Events
There are multiple asynchronous events which must occur before an exchange is ready for consumption.
In order for clients to be able to track exchange-related events, such as when exchanges are fulfilled with data,
or ready to be viewed, you can subscribe to any of the exchange-related events below.
The Data Exchange API uses Data Events Service to publish these events. For details on how to subscribe to events
using Data Events Service, see the POST /v1/subscriptions REST API
docs in the APS doc portal.
All that is needed is the namespace and event type to subscribe. See payload responses and subscription examples below.
Event Types
fdx events.exchange.created-1.0.0 | This event is published when an exchange has been created. |
fdx events.exchange.modified-1.0.0 | This event is published when an exchange has been updated. |
fdx events.exchange.fulfilled-1.0.0 | This event is published when the exchange is fulfilled with data intended to be shared. The data is ready for download but not ready to be queried using complex search filters. The data section will show the final status of the fulfillment, i.e., if it was DISCARDED, FAILED, or FINISHED. |
fdx events.exchange.viewable-1.0.0 | This event is published when an exchange is viewable on supported hosts. |
Environment Publish System Ids
Environment | Publish System Id |
---|---|
dev | autodesk.data.dev |
stg (ALL regions) | autodesk.data.stg |
prd (ALL regions) | autodesk.data |
Published Event Payloads
Event: events.exchange.created
:
{
"specversion": "1.0",
"id": "<guid>",
"source": "urn:com.autodesk.forge:clientid:fdxs",
"type": "<publish_system_ids>:events.exchange.created-1.0.0",
"subject": "urn:autodesk.data:exchange:<exchange_id>",
"time": "2024-06-10T19:00:06.831Z",
"data": {
"collectionurn": "urn:autodesk.data:collection:<collection_id>",
"type": "<exchange_type>",
"url": "/v1/collections/<collection_id>/exchanges/<exchange_id>",
"exchangeId": "<exchange_id>",
"collectionId": "<collection_id>",
"revisionId": "<revision_id>"
}
}
Event: events.exchange.modified
{
"specversion": "1.0",
"id": "<guid>",
"source": "urn:com.autodesk.forge:clientid:fdxs",
"type": "<publish_system_ids>:events.exchange.modified-1.0.0",
"subject": "urn:autodesk.data:exchange:<exchange_id>",
"time": "2024-06-10T18:54:05.430Z",
"data": {
"collectionurn": "urn:autodesk.data:collection:<collection_id>",
"type": "<exchange_type>",
"url": "/v1/collections/<collection_id>/exchanges/<exchange_id>",
"exchangeId": "<exchange_id>",
"collectionId": "<collection_id>",
"revisionId": "<revision_id>"
}
}
Event: events.exchange.fulfilled
{
"specversion": "1.0",
"id": "<guid>",
"source": "urn:com.autodesk.forge:clientid:fdxs",
"type": "<publish_system_ids>:events.exchange.created-1.0.0",
"subject": "urn:autodesk.data:exchange:<exchange_id>",
"time": "2024-06-10T19:03:46.250Z",
"data": {
"collectionurn": "urn:autodesk.data:collection:<collection_id>",
"type": "<exchange_type>",
"url": "v1/collections/<collection_id>/exchanges/<exchange_id>/fulfillments/<fulfillment_id>",
"exchangeId": "<exchange_id>",
"collectionId": "<collection_id>",
"fulfillmentId": "<fulfillment_id>",
"status": "INITIAL|IN_PROGRESS|DELETED|FINISHED|FAILED"
}
}
Event: events.exchange.viewable
{
"specversion": "1.0",
"id": "<guid>",
"source": "urn:com.autodesk.forge:clientid:fdxs",
"type": "<publish_system_ids>:events.exchange.created-1.0.0",
"subject": "urn:autodesk.data:exchange:<exchange_id>",
"time": "2024-06-10T19:06:49.237Z",
"data": {
"collectionurn": "urn:autodesk.data:collection:<collection_id>",
"type": "autodesk.data:exchange-1.0.0",
"url": "/v1/collections/<collection_id>/exchanges/<exchange_id>",
"exchangeId": "<exchange_id>",
"collectionId": "<collection_id>",
"revisionId": "<revision_id>",
"status": "SUCCESS|FAILED"
}
}
Listening to events for an Exchange
For example, to listen to all events for a given exchange:
curl --location 'https://developer.api.autodesk.com/fevnt-d/v1/subscriptions ' \
--header 'Authorization: Bearer '$TOKEN \
--header 'Content-Type: application/json' \
--header 'region: US' \
--data '{
"entityUrn": "urn:autodesk.data:exchange:17d115d8-9b5a-3774-b035-3a436b9391d2",
"eventType": "autodesk.data.fdx:events.*-1.0.0",
"permissionUrn": "urn:autodesk.data:exchange:17d115d8-9b5a-3774-b035-3a436b9391d2",
"protocol": "HTTPS",
"filters": [],
"callbackUrl": "https://webhook.site/78c14038-34b4-4e45-94ba-6ec65849bfef",
"subscriptionExpiry": "2023-04-10T01:15:36Z"
}
'