automating API key

One of the ways to authenticate to our range of data validation APIs is to use an API Key. They provide a simple, convenient way of adding data validation to server- or client-side apps with minimal coding.

If you use it on a website, in order to keep your key secure one of the steps we take is to ensure it’s only being used from a website you’ve specifically allowed. You can do this easily from the API Key page.

However, if you’ve got a large number of domains, managing this manually becomes time consuming and error prone, so you can now automate this process using our management API.

 

Authenticating

Unlike our data validation APIs, which you can authenticate to using either username & password, API key or JWT, our management API requires the use of OAuth client credentials. You can generate a client ID and secret from the Security Settings page of our dashboard.

Once you have a client ID and secret you can authenticate to our API using the programming library of your choice. For testing purposes you can also browse to https://api.data-8.co.uk and click the “Authorize” button in the top right and enter your details.

 

Creating an API Key

If you don’t already have one, you can create a new API key by making a POST request to the /ApiKey endpoint, e.g.

				
					POST /ApiKey
Host: api.data-8.co.uk
Content-Type: application/json

{
  "description": "My new API key"
}
				
			

This will generate and return the details of the new key, e.g.

				
					200 OK
Content-Type: application/json

{
  "key": "ABCD-1234-EFGH-5678",
  ...
}
				
			

Adding allowed domains

Once you have your key, you can authorise it to be used from new domains by making a PUT request to the /ApiKey/{key}/allowedDomains/{domain} endpoint, e.g.

				
					PUT /ApiKey/ABCD-1234-EFGH-5678/allowedDomains/example.com
Host: api.data-8.co.uk
				
			

You can now use your key on the newly authorised domain.

Contact us

Have a question or want to enquire about our 14 day FREE trial, get in touch us here
Contact Us

Pricing Plan

We pride ourselves on having a plan to suit every business and a price to suit every budget.
Pricing Plan

Data8 Blogs

Go back to our blog page to read more of our news and views
Find out more

Join the Conversation

Receive the latest news, views and hot topics directly in your inbox! Sign up below

Follow us on social media