How to delete subscriptions

Pre-requisites

In addition to the guidance on this page the guidance and requirement on the Generic Subscription API Requirements page SHALL be followed when using the NEMS subscription API.

Deleting a Subscription

To delete a specific subscription, the client will need to use the Logical ID that was allocated to the subscription when it was created (see Create Subscriptions)

HTTP request

To delete a subscription by its logical ID, a standard FHIR delete operation can be used:

DELETE /Subscription/[Subscription_Logical_ID]

Request Headers

The system calling the API MUST include the following HTTP request headers when making the call to the Delete Subscription API endpoint:

Header Description
fromASID ASID of the system calling the Subscription API
toASID ASID of the NEMS service
InteractionID Fixed value: urn:nhs:names:services:clinicals-sync:SubscriptionsApiDelete

Additional information about standard headers and endpoints is available in the Spine Core specification.

Error Handling

If an error occurs while trying to process the request the NEMS will return a HTTP error code along with an OperationOutcome FHIR resource within the payload. The OperationOutcome resource will contain one of the Spine ErrorOrWarning Codes and conform to the structure set out in the Spine Core FHIR specification.

Response

Where a subscription is found for the logical ID and is deleted by the NEMS, the response will be:

  • a HTTP status code of 200.

Delete Subscription Example

DELETE https://clinicals.spineservices.nhs.uk/STU3/Subscription/ea0a485187204b49b978bdcf7102388c
HTTP 200 OK
Date: Sat, 26 May 2018 12:52:12 GMT
Tags: fhir