Retrieving Structured Funeral Data
When you receive a notification about funeral data changes, you can retrieve the updated data in a structured format using the petition endpoints. This enables you to process funeral information more efficiently than with unstructured attachments.
Prerequisites
Before retrieving structured data:
- You must have appropriate authorization credentials
- A funeral responsible must be established for the funeral
- You should receive an event notification with the necessary identifiers
Warning
The funeral petition endpoints can only be used when a funeral responsible has already been set in DGM. If no funeral responsible is set, the funeral petition endpoints will not return any data (404 Not Found).
Implementation Steps
1. Receive an Event Notification
Events will include the identifiers you need to retrieve data:
{
...,
"type": "no.dgm.v1.funeral.updated",
"data": {
"funeralId": "00000000-0000-0000-0000-000000000000",
"responsibilityStatementId": "00000000-0000-0000-0000-000000000000",
"partyId": "00000000-0000-0000-0000-000000000000",
"locationIds": ["0301"],
"funeralHomeId": "12345",
"crematoriumId": null
},
...
}
2. Verify Event Relevance
Determine if the event is relevant to your system based on:
locationIds
: For graveyard authoritiescrematoriumId
: For crematoriumsfuneralHomeId
: For funeral homes
3. Retrieve the Responsibility Statement
Get the latest responsibility statement:
GET /dgm/api/graveyard-authority/responsibility-statements/{id}
or
GET /dgm/api/funeral-home/responsibility-statements/{id}
4. Retrieve petition data
Get the structured funeral petition data:
GET /dgm/api/v1/funeral-petitions/{partyId}
This endpoint will return a comprehensive data structure containing all components:
{
"partyId": "00000000-0000-0000-0000-000000000000",
"data": {
"responsibilityStatement": {
...
},
"grave": {
...
},
"rites": [
...,
...
]
}
}
5. Retrieve Type Definitions for Interpretation
To correctly interpret the rite and grave types in the petition, retrieve the type definitions:
GET /dgm/api/v1/definitions/grave-types
GET /dgm/api/v1/definitions/rite-types
6. Retrieve Additional Attachments (If Needed)
For any additional attachments associated with the funeral:
GET /dgm/api/graveyard-authority/attachments?Id={partyId}&associatedEntityType=party
Then retrieve each attachment by its file ID:
GET /dgm/api/graveyard-authority/attachments/{fileId}
Understanding Component Status
When retrieving petition data, be aware that each component may be in different states:
Error Handling
Common errors when retrieving data:
Status Code | Description | Action |
---|---|---|
404 | Data not found | Check if a funeral responsible has been set |
403 | Not authorized | Verify your authorization credentials |
500 | Server error | Implement retry with exponential backoff |
Best Practices
- Cache Definitions: Type definitions change infrequently - cache them
- Event-Driven Retrieval: Only fetch data when events indicate changes
- Merge Data: Merging the data should happen at your end, not in DGM
Next Steps
- Understand event subscriptions for staying updated
- Learn about common integration workflows