This version is in beta - expect some breaking changes.
Pull Notifications API
|Available in Sandbox||Yes|
|Sandbox base URL||https://test-api.service.hmrc.gov.uk|
|Available in Production||Yes|
|Production base URL||https://api.service.hmrc.gov.uk|
This API enables your application to “pull” notifications from some of our services, if they couldn’t “push” their notifications to it. The other service advises you if this service is available for your application.
For example, if you submit a form to an API, such as the Customs Declaration Service (CDS), it accepts it with an HTTP status code 202 but then waits for further human intervention. After this intervention happens, CDS has a new notification for your application.
CDS tries to push this notification to your application, but if this fails then they add this notification to the notification queue. Failure can happen if your system is down, or your firewall rules prevent it, or you choose to use this pull method instead.
In this case, your application can now pull the notification from the queue using this Pull Notifications API.
Once you pull your notification it is deleted automatically.
When an API changes in a way that is backwards-incompatible, we increase the version number of the API. See our reference guide for more on versioning.
We use standard HTTP status codes to show whether an API request succeeded or not. They are usually in the range:
- 200 to 299 if it succeeded, including code 202 if it was accepted by an API that needs to wait for further action
- 400 to 499 if it failed because of a client error by your application
- 500 to 599 if it failed because of an error on our server
Errors specific to each API are shown in the Endpoints section, under Response. See our reference guide for more on errors.
You can use the sandbox environment to test this API.
To set up a test notification, you need to use another service to generate a notification which it must then fail to push. Then you can pull the notification using this API.