API: authentication

Error

Error updating site page. We've logged the issue, please try again later.

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. Select the green menu icon to open the drawer
  3. Select the name of your organisation (a link near the top of the drawer, below your name)
  4. If you have more than one subscription, open the subscription you wish to use for API access
  5. Click on API access to open the keys panel.

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

Find your API keys (admins only)

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 query string of your request. You add the Uri key to your request as the "key" parameter. For example:

https://www.careopinion.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.

;