We have detected that you are using Internet Explorer to visit this website. Internet Explorer is now being phased out by Microsoft. As a result, NHS Digital no longer supports any version of Internet Explorer for our web-based products, as it involves considerable extra effort and expense, which cannot be justified from public funds. Some features on this site will not work. You should use a modern browser such as Edge, Chrome, Firefox, or Safari. If you have difficulty installing or accessing a different browser, contact your IT support team.
Testing APIs
Learn about the environments we provide to test your software with our APIs.
Overview
We provide environments to test your software with our APIs. There are different environments depending on which APIs you are using.
For some of our APIs, you must give evidence of your testing before you go live as part of our onboarding process.
This page includes some general information, but to find out about testing a particular API, read its documentation in our API catalogue.
Sandbox testing
Some of our APIs have a sandbox environment you can use for early testing.
Sandbox APIs don't usually require authorisation and are usually stateless - they return hard-coded responses.
To find out about sandbox testing for a particular API, read its documentation in our API catalogue.
Integration testing
Some of our APIs have an integration test environment you can use for more realistic testing.
The different approaches to integration testing are explained below. For details on a particular API, read its documentation in our API catalogue.
Integration testing with our RESTful APIs
For some of our RESTful APIs, you can access our integration test environments as follows:
1. Create an application and activate APIs
- If you don't already have one, create a developer account.
- Navigate to my developer account and sign in.
- Select 'My applications'.
- Select '+ NEW APP'.
- Enter details for your application.
- In the 'APIs' section, find the testing APIs you want to test with and activate them by clicking the slider.
- If you are using user-restricted APIs, specify your application's OAuth 2.0 Callback URL.
- Select 'CREATE' to create the application.
- Make a note of the API key and secret.
2. Generate a key pair, if required
If you are using signed JWT authentication, you need to generate a private/public key pair for testing and register your public key with us.
For details, see Application-restricted RESTful APIs - signed JWT authentication.
3. Configure your software for testing
To get your software working with our integration test environment, configure the following:
- Base URL for APIs: https://int.api.service.nhs.uk
- OAuth client ID and client secret (if needed): use the API key and secret from the previous step
- Base URL path for our authorisation server (if needed) as follows:
Type of testing | Authorisation server base URL |
---|---|
User-restricted API - simulated sign-in - no smartcard needed - use for early testing |
https://int.api.service.nhs.uk/oauth2-no-smartcard |
User-restricted API - NHS Identity sign-in with smartcard or modern alternative | https://int.api.service.nhs.uk/oauth2 |
Application-restricted API - signed JWT authentication | https://int.api.service.nhs.uk/oauth2 |
4. Set up smartcard access, if required
If your software is using smartcards for user authentication, do the following:
- get an ODS code - you’ll need one before you can access the Health and Social Care Network
- get access to the Health and Social Care Network
- get physical smartcards for testing
- download client software, including the Identity Agent (IA) and the NHS Identity Hub
You must use a Windows platform with your software, including the .NET framework.
The following Windows operating systems are supported:
- Windows 10
- Windows 8.1
The NHS Identity Hub does NOT work with Internet Explorer, you will need to use a non-IE internet browser. The following browsers are supported:
- Edge version 79 or above
- Chrome version 72 or above
- Firefox version 62 or above
For more details, contact us.
5. Set up test data, if required
Some of our APIs include standard test data packs.
In some cases you might need to set up your own test data, for example:
- to test specific cases that the standard test pack doesn't cover
- to test data updates, for example patient data in PDS
To set up your own test data, you can either:
- use our Test Data Self-Service Portal (TDSSP) test data tool - but you need an HSCN connection - or
- contact us to set up test data for you
To request access to our Test Data Self-Service Portal (TDSSP):
-
contact us at testdata@nhs.net for the URL, username and password you’ll need to access the tool
-
tell us if you need access to a specific test pack for update testing, for example, for PDS update testing we recommend the PDS Compliance Pack
For more details, contact us.
6. Start testing
During testing, for user-restricted APIs you need to sign in as an end user, as follows:
- if your test environment is set up for smartcard access, use the smartcard you set up in step 3 above
- if your test environment is set up for simulated sign-in, simply click the 'sign in' button - you don't need any credentials
Integration testing with our HL7 V3 APIs
Our HL7 V3 APIs have a number of Path to Live environments for integration testing, including:
- Development - early sandbox testing
- Integration - end-to-end and regression tests
- Deployment - test in situ and user acceptance tests
- Proof of concept
- Non-functional tests
For more details see Path to Live environments.
Performance testing
We do not provide environments for performance testing.
Moreover, the path-to-live environments for our RESTful APIs have low rate limits to protect them against overuse.