Getting Started

We've written some documentation to help you get started with our api.
Don't be afraid to reach out and ask for help! Call us on 0343 005 9302 or ask us on live chat if you're confused.

Our API is nice and simple to use (by our estimation 😅). It is a single route, and you use your request headers to determine which list or lists you would like to screen against. We require your authorization token to be placed into the 'Authorization' header. You do not need to prefix the authorization token with the word bearer or token. The Authorization header should only contain your token.

POST
https://service.tpsapi.com

You MUST include your authorization token in the 'Authorization' header. You can find your authorization token on your account screen when you are logged in. In addition to the authorization header, we require at least one additional header in your request before we will accept it. You must choose at least one list to screen against. The header to screen against the TPS is 'check-tps' and the header to screen against the CTPS is 'check-ctps'. You can use both headers at the same time, which will screen your data against both lists!

Request Headers

Header KeyPurposeHeader Value
content-typeTells the API your request and response will be using the JSON format.application/json
authorizationThe authorization token given to you by us. This is unique to your account and should not be shared with anyone else.Found on your account page.
check-tpsInclude this header if you want to screen numbers against the TPS list. Can be used with 'check-ctps'.true
check-ctpsInclude this header if you want to screen numbers against the CTPS list. Can be used with 'check-tps'.true
return-callable-numbers-onlyOnly numbers that are NOT on the selected list(s) will be returned. If a number is misformatted, it won't be returned.true
return-prettier-numbersReturns an additional 'prettier_phone_number' field in the response JSON, formatted according to Offcom guidelines.true
return-date-addedReturns the date each phone number was added to the TPS, CTPS, or FPS. If not found, no date is returned.true
no-loggingPrevents storing full numbers in logs; only the first 6 digits will be saved (e.g., 0123456XXXX). Limits support capabilities.true

Request Body

Your request MUST include a JSON request body. The body needs to include an array with the key "phone_numbers".

Body KeyPurposeBody Value
phone_numbersThe array of phone numbers that you would like to screen against your chosen list(s).application/json

Response Codes

Response CodeMeaning
200Success, you should have your results in the JSON body of the response!
400The request is missing a header, the response message should give more details on the specifics of which header you are missing.
401The request is either missing the authorization header, the authorization token in the header is incorrect, or your account does not have sufficient tokens to make this request. The response message will specify which of these errors is the problem.
403Your account has been disabled.
413The request contains too many phone numbers. There is a maximum limit of 10,000 numbers per request. This request has exceeded that 10,000 limit.

Axios Example

const phoneNumbers = ["01256001001", "01256001002"]; const response = await axios.post('https://service.tpsapi.com', { phone_numbers: phoneNumbers }, { headers: { Authorization: 'authorization-code-here', ['check-tps']: true, ['check-ctps']: true, ['return-prettier-numbers']: true, } });

Python Example

import http.client conn = http.client.HTTPConnection("https://service.tpsapi.com") payload = "{ "phone_numbers": [ "01256001001", "01256001002" ] }" headers = { 'Content-Type': "application/json", 'check-tps': "true", 'check-ctps': "true", 'return-prettier-numbers': "true", 'authorization': "authorization-code-here" } conn.request("POST", "/", payload, headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))

PHP Example

$client = new httpClient; $request = new httpClientRequest; $body = new httpMessageBody; $body->append('{ "phone_numbers": [ "01256001001", "01256001002" ] }'); $request->setRequestUrl('https://service.tpsapi.com'); $request->setRequestMethod('POST'); $request->setBody($body); $request->setHeaders([ 'Content-Type' => 'application/json', 'check-tps' => 'true', 'check-ctps' => 'true', 'return-prettier-numbers' => 'true', 'authorization' => 'authorization-code-here' ]); $client->enqueue($request)->send(); $response = $client->getResponse(); echo $response->getBody();