Event¶
The system provides create, update and delete event for every document.
Document created¶
Document created event is of type core.webhook.event.document-created and contains fields:
- application - application ID of a document owner
- document - relationship to a document
- document-snapshot - snapshot of a document after creation
Example:
{
"type": "core.webhook.event.document-created",
"attributes": {
"application": "59bc546eac61057832977b4b",
"document-snapshot": {
"data": {
"type": "car",
"id": "5a3fedcda01c5b5f6eea162a",
"attributes": {
"name": "Rimac Concept_One",
"powertrain": "electric",
"year": 2017,
"mileage": 10000
},
"links": {
"self": "https://api.jazer.io/resources/car/5a3fedcda01c5b5f6eea162a"
}
}
}
},
"relationships": {
"document": {
"data": {
"type": "car",
"id": "5a3fedcda01c5b5f6eea162a"
}
}
}
}
Document updated¶
Document updated event is of type core.webhook.event.document-updated and contains fields:
- application - application ID of a document owner
- document - relationship to a document
- old-document-snapshot - snapshot of a document before an update
- changes - requested document changes
- new-document-snapshot - snapshot of a document after an update
Example:
{
"type": "core.webhook.event.document-updated",
"attributes": {
"application": "59bc546eac61057832977b4b",
"old-document-snapshot": {
"data": {
"type": "car",
"id": "5a3fedcda01c5b5f6eea162a",
"attributes": {
"name": "Rimac Concept_One",
"powertrain": "electric",
"year": 2017,
"mileage": 10000
},
"links": {
"self": "https://api.jazer.io/resources/car/5a3fedcda01c5b5f6eea162a"
}
}
},
"changes": {
"type": "car",
"id": "5a3fedcda01c5b5f6eea162a",
"attributes": {
"mileage": 12000
}
},
"new-document-snapshot": {
"data": {
"type": "car",
"id": "5a3fedcda01c5b5f6eea162a",
"attributes": {
"name": "Rimac Concept_One",
"powertrain": "electric",
"year": 2017,
"mileage": 12000
},
"links": {
"self": "https://api.jazer.io/resources/car/5a3fedcda01c5b5f6eea162a"
}
}
}
},
"relationships": {
"document": {
"data": {
"type": "car",
"id": "5a3fedcda01c5b5f6eea162a"
}
}
}
}
Document deleted¶
Document deleted event is of type core.webhook.event.document-deleted and contains fields:
- application - application ID of a document owner
- document - relationship to a document
- document-snapshot - snapshot of a document before a deletion
Example:
{
"type": "core.webhook.event.document-deleted",
"attributes": {
"application": "59bc546eac61057832977b4b",
"document-snapshot": {
"data": {
"type": "car",
"id": "5a3fedcda01c5b5f6eea162a",
"attributes": {
"name": "Rimac Concept_One",
"powertrain": "electric",
"year": 2017,
"mileage": 12000
},
"links": {
"self": "https://api.jazer.io/resources/car/5a3fedcda01c5b5f6eea162a"
}
}
}
},
"relationships": {
"document": {
"data": {
"type": "car",
"id": "5a3fedcda01c5b5f6eea162a"
}
}
}
}