Resend Webhooks
Medplum implements a custom operation, $resend
, that can be used to trigger Subscriptions listening to a a particular resource. The operation takes an optional option
parameter, which is an object containing three fields:
Option | Description | Data Type | Default Value |
---|---|---|---|
verbose | Indicates if verbose logging should be enabled. | boolean | false |
interaction | Subscriptions can be configured to trigger only when a resource is created or deleted as opposed to any update. This option allows you to specify which interaction type will be sent. | update | create | delete | update |
subscription | A specific Subscription to trigger, formatted as Subscription/<id> . If left undefined, all Subscriptions will be triggered. | string | undefined |
Invoke the $resend
operation
- TypeScript
- CLI
- cURL
const medplum = new MedplumClient();
// auth...
await medplum.post(medplum.fhirUrl(<resourceType>, <id>, '$resend'), {
verbose: true,
interaction: 'update',
subscription: 'Subscription/123'
});
medplum login
medplum post '<resourceType>/<id>/$resend' {"verbose":"true","interaction":"update","subscription":"Subscription/123"}
curl 'https://api.medplum.com/fhir/R4/<resourceType>/<resourceId>/$resend' \
-X 'POST' \
-H 'authorization: Bearer MY_ACCESS_TOKEN' \
-H 'content-type: application/fhir+json' \
--data-raw '{"verbose":"true","interaction":"update","subscription":"Subscription/123"}'
Output
If successful, you will receive the following OperationOutcome
{
"resourceType": "OperationOutcome",
"id": "ok",
"issue": [
{
"severity": "information",
"code": "informational",
"details": {
"text": "All OK"
}
}
]
}
Related Documentation
- Refer to Subscriptions to learn more about Medplum's implementation of FHIR Subscriptions