Webhooks
Time-to-live
If the consumer is down, events will be stored for one day (86400 seconds).
Error handling
Depending on the HTTP response codes from the consumer the following actions will be taken
State | Action | Comment |
|---|---|---|
<connection problems> | Retry | With exponential back-off (powers of 2) |
HTTP code [200,299] | Success |
|
HTTP codes [300,399] + 410 | Abort web hook |
|
HTTP codes [400,599] - 410 | Retry | With exponential back-off (powers of 2) |
Unknown HTTP code | Retry | With exponential back-off (powers of 2) |
Formats
The following two formats are supported
Format | Description | Since |
|---|---|---|
Xml | Outputs in XML using a Premis event V2 |
|
XmlPremisV3 | Outputs in XML using a Premis event V3 https://www.loc.gov/standards/premis/v3/index.htmland includes the https://mediahaven.atlassian.net/wiki/spaces/CS/pages/4058742786. |
|
Example for XmlPremisV3
Example format Xml (default)
Event Types
Depending on the user's functions, webhooks can return two types of events. Each event includes the fully qualified event type, such as RECORDS.FLOW.ARCHIVED or USERS.FLOW.ROLES.
Premis events
Webhooks return premis events of records to which the user has read access. The event name always start with prefix RECORDS. The different event types are documented here https://mediahaven.atlassian.net/wiki/spaces/CS/pages/1490485332
Audit events
If the user has the function ADMIN_EDIT_ALL_ORGANISATIONS, https://mediahaven.atlassian.net/wiki/spaces/CS/pages/4400775176 from other concepts are also included.
Premis Event Links
The links in a premis event have of the two following formats
MediaObjectId(64 characters)FragmentId(96 characters)
Variants
When the link is a
MediaObjectIdthe event pertains to all fragments of the recordWhen the link a
FragmentIdthe event pertains to only this specific fragmentsCertain events such deleting the entire record will emit a
DELETEevent for each fragment with its ownFragmentId
Tip
When requesting the events in JSON format you are guaranteed to always have the property FragmentId in addition to the Links whereas in the XML format only the links viapremis_event:linkingObjectIdentifier are present
Filters
When registering a webhook, you can define a filter to specify that only events of certain (sub) event types or (sub) record types should be received. Wildcards at the end are allowed. For example, the following webhook will only return update events for records with main record type Media:
"Filter": {
"RecordTypes: ["Media", "Media.*"],
"EventTypes": ["RECORDS.UPDATE", "RECORDS.UPDATE.*"]
}If a user with the ADMIN_EDIT_ALL_ORGANISATIONS function only wants to receive premis events of records, the following filter can be applied:
"Filter": {
"EventTypes": ["RECORDS.*"]
}Permissions change
When the permissions of a record change in such manner the web hook user gains or losses the read right, in a narrow period around this transition events could be missed.
As such the UPDATE event which removes or adds the read right of the web hook user, may or may be not received by the web hook user.