Version 2 API: authentication

To access the version 2 API you need to authenticate using a valid API key.

How to find your API keys

To obtain an API key you need a current subscription which includes API access at either the Basic or Enhanced level.

Then, to find your keys:

  1. Log into your subscription
  2. Go to your subscription overview (select the name of your subscription in the top navigation bar)
  3. Click on API access to open the keys panel.

Note that you must be an administrator in the subscription to access they API keys.

API keys panel

How to use your API keys

There are two different API keys associated with your subscription. Each key works in a different context and has a different lifetime.

Uri key

The Uri key can be used directly in the querystring of your request. You add the Uri key to your request as the "key" parameter. For example:

https://www.patientopinion.org.uk/api/v2/opinions?key=your_key_here

As a security precaution, the Uri key expires 24 hours after creation. You can regenerate it at any time to extend the expiry time.

HTTP header key

The HTTP header key can be used in the Authorization header of your request.

To use the HTTP header key, add an Authorization header to your request. Set the value of the Authorization header to:

SUBSCRIPTION_KEY your_key_here

This key does not expire.

You can regenerate the key at any time. Note that if you regenerate the key, any applications relying on the previous key will no longer have access to the API.