Event Format
Data Events Service adheres to the CloudEvents specification.
An example CloudEvent event for the Data System API (aka L2) follows:
{
"id" : "7be945d4-88cb-4b19-8dc9-f1dace8ff0c8",
"source" : "urn:autodesk:service:5zw90va0UuwMKTnPS5sLsdgZjDkVYXN7",
"specversion" : "1.0",
"type" : "autodesk.data.assetgraph:events.asset.created-1.0.0",
"subject" : "urn:autodesk.data.assetgraph:asset:co.2IdPqpWJTo6f4UxqSF_QMg",
"time" : "2020-03-11T17:54:07.074+00:00",
"dataschema" : "http://forge.autodesk.com/schemas/data-event-schema-v1.0.0.json",
"data" : {
"note": "data is a JSON object composed of Common Data Object fields & L2 object fields",
"commandid": "9568245c-5652-4bc5-9816-9f3aab3bbe77",
"acescopeurn": "urn:autodesk:acescope:9021923212",
"collectionurn": "urn:autodesk.data.assetgraph:collection:co.oeq8pG2JQyO-TewgIWD3FQ",
"modificationtype": "components",
"scopes": [
"urn:autodesk.data.assetgraph:space:co.5kDFyA4kRDmZH0jJO1u0FA"
]
}
}
Show More
The following table lists required fields in the CloudEvent. All fields are required unless otherwise stated.
Name | Data type | Description |
---|---|---|
id | String | Unique identifier of the event. Consumers can assume that events with identical source and ID are duplicates. |
source | URN | URN of the source of the event. Use this URN to uniquely identify the source application or service. |
specversion | String | CloudEvent specification version - must be 1.0. |
type | String | Type of the event. Prefix with a reverse-DNS name. The prefixed domain dictates the organization that defines the semantics for this event type. This field follows the Event Type ID field format: <namespace>:<eventType>-<semverVersion> |
subject | URN | Identifier of the object about which the event is reported in Entity URN format: urn:<namespace>:<type>:<ID> For example, urn:autodesk.data.assetgraph:asset:co.2IdPqpWJTo6f4UxqSF_QMg |
time | Timestamp | Timestamp for when the event occurred, in RFC3339 format. |
data | Object | Payload of the event as a JSON object. Contains the type-specific data of the event. |
The following table lists optional fields in the CloudEvent.
Name | Data type | Description |
---|---|---|
traceparent | String | Contains a version, trace ID, span ID, and trace options as defined in the W3C Distributed Trace Context Specification. |
tracestate | String | A comma-delimited list of key-value pairs, defined by W3C Distributed Trace Specification. Unified Logging trace headers would be embedded here. |
datacontenttype | String | Use this parameter when the content type of data is not application/json. |
dataschema | URI Reference | A reference to the versioned JSON schema specification of the data object in the event. |
sequence | Integer | Value expressing the relative order of the event. This enables interpretation of event supercedence. |
The following table lists common fields within the data field of all events. All fields are required unless otherwise stated.
Name | Data type | Description |
---|---|---|
scopes | Array | Optional. Array of related entity IDs, in URN format (urn:<namespace>:<type>:<ID>). Used to implement event roll-up. If provided, Data Events Service inspects subscriptions for these objects and publishes the event to subscribers of the scoped entity. NOTE: Scopes are not passed through to consumers of the event. |
customProperties | Object | Optional. A custom set of properties may be specified on each event that is published. Those custom properties can be utilized in the Event Definition Object (EDO) and passed to the permissions API call. customProperties is just a property bag of key-value pairs that have no semantic meaning beyond what is defined in the permissions API call. |
acescopeurn | URN | Optional. The ACE Scope identifier of the collection in which the event occurred, in URN format: urn:<namespace>:<type>:<ID>. For example, urn:autodesk:acescope:9021923212. |
commandid | String | Required for Data System APIs (aka L2) events, otherwise optional. The commandId (transactionId) of the event in L2 platform (a L2 command or batch-command Id) |
collectionurn | URN | Required for Data System APIs (aka L2) events, otherwise optional. The collection ID to which the event pertains, in URN format |
Versioning of Events
There are two places that version is specified – in the type field and in the dataschema field. For the type field, please see the Event Type ID documentation. For the dataschema field, see Versioning of CloudEvents.