POST /Token

Obtain an authorisation token for use in calling restricted api endpoints. Only the client credentials grant is currently supported.

Request Information

URI Parameters

None.

Headers

Mandatory http headers

NameDescriptionTypeAdditional information
Authorisation

Basic authorisation header

string Base64 encoded username:password string

Body Parameters

The grant type

NameDescriptionTypeAdditional information
grant_type

The type of grant required

string Only client_credentials grant type is currently supported.

application/x-www-form-urlencoded

Sample:
grant_type=client_credentials

Response Formats

HTTP response status code: 200

The token response in json format.

application/json

Sample:
{
    "access_token":"2YotnFZFEjr1zCsicMWpAA",
    "expires_in":3600,
    "token_type":"bearer"
}
                    

HTTP response status code: 403

When the user has submitted too many requests, no further requests should be made until after 5 minutes

text/plain

Sample:

Body:

<html><head><title>Forbidden - Contracts Finder</title></head><body><p><h1><strong>Request forbidden</strong></h1></p><p>The request rate limit may have been exceeded. If you believe this is an error <a href="https://www.contractsfinder.service.gov.uk/Home/Contact">contact us</a> quoting 0QrFmYQAAAABs5RRpp9L8RbtJ8k4jz8gwTE9OMjFFREdFMDIwOABiYTEyMjkxMi0zZWE0LTQ1NTQtYjNjNi1mNmRmZDU2MGY2ZDM=.</p></body></html>