Skip to main content

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.

To find out about integration testing for 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 a developer account

If you don't already have one, create a developer account.

If you already have an account, go to my developer account and sign in.

2. Create an application and activate APIs

  1. navigate to my developer account
  2. select 'My applications'
  3. select '+ NEW APP'
  4. enter details for your application
  5. in the 'APIs' section, find the testing APIs you want to test with and activate them by clicking the slider
  6. select 'CREATE' to create the application
  7. make a note of the API key and secret

3. Configure your software for testing

To get your software working with our integration test environment, configure the following:

  1. OAuth client ID and client secret: use the API key and secret from the previous step
  2. base URL for our test environment: https://int.api.service.nhs.uk

4. Set up smartcard access, if required

If your software is using smartcards for user authentication, do the following:

  1. get access to the Health and Social Care Network
  2. get physical smartcards for testing
  3. download client software, including the Identity Agent (IA) and the NHS Identity Hub

For more details, contact us.

5. Set up test data, if required

Some of our APIs include standard test data packs that you can use without needing to set up any test data yourself.

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 tool - but you need an HSCN connection - or
  • contact us to set up test data for you

To request access to the test data tool, contact testdata@nhs.net.

For more details, contact us.

 

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.

Last edited: 31 March 2020 3:33 pm