Sign up Login

TPS Bulk

API Method: tps_bulk

Description

This method allows for the appending of telephone numbers to your CSV.

Your CSV can contain residential or business data.

The data must be uploaded to T2A as a csv with at least one column that contains telephone numbers. The process automatically detects which columns contain telephone numbers.

T2A will append these further columns to the CSV:-

  • result (FOUND, NOT FOUND)
  • telephone number
  • TPS/CTPS status of the telephone number. We check against both the TPS and CTPS data.

Usage

This is an asynchronous method, requiring several stages in the operation.

  1. Create a job (also known as a transaction). This is a unique item that will be used to upload, process and finally download your data. Create the job using the create command. Please note that this is a free method.
  2. Upload your csv data. This is free.
  3. Start the checking process. It runs in the backgroumd.
  4. Invoke the progress command to monitor the progress of T2A in processing your job. You may wish to display this as a progress bar or similar to your final users. The invocation of this method is normally from JavaScript. When the percentage figure has reached 100, the processing is complete, and you may proceed to the next stage. Nothing is chargeable yet.
  5. When the process is completed, view a summary of the results.
  6. If you wish to purchase the full result (i.e. the original csv with all telephone numbers TPS checked ), invoke the finalise command which will prepare the data, deduct the necessary credits, and supply a download URL which can be used to obtain the purchased csv.

Commands

Introduction

The individual operations of this method are selected using the mandatory command parameter.

Command 'create'

Create a transaction (also known as a job) to be used for your upload, append and download. This is free.

Mandatory Parameters

Name Description
api_key or javascript_key Use your API key if invoking server-side. If invoking from the browser via JavaScript, generate a JavaScript key using the javascript_key method.
command Must be set to create

Optional Parameters

Name Description
client You can optionally include an identifier for your final client or user. This is logged in your usage log and you will be able to view your usage statistics by client.
output Set to json for a JSON response; the default response is XML. Not applicable to the SOAP API.
callback When using JSON, specify a JSONP wrapper in which the JSON response is to be wrapped.

Returned Values

The XML response is contained within a <tps_bulk_res> element.

Name Description
status Returns ok if the operation has succeeded, or error if an error has occurred; Returns the error_code for error details.
error_code

Returns the error code when the status is error. See below for error codes.

transaction_id The ID of the job created.
t2a_version_number The current API version number.

Example XML Response


<?xml version="1.0"?>
<tps_bulk_res>
	<mode>normal</mode>
	<status>ok</status>
	<t2a_version_number>3.2.3.1f</t2a_version_number>
	<transaction_id>wKVrW6dhYPMBEA0iQTuJ_u9YQx_L1fOvVqQ1AOboPS_U</transaction_id>
</tps_bulk_res> 

Command 'upload'

Upload your csv data to T2A.

Mandatory Parameters

Name Description
api_key or javascript_key Use your API key if invoking via server-side XML or SOAP. If using JSON, generate a JavaScript key using the javascript_key method.
command Must be set to upload
transaction_id The ID of the job, as created by create.
csv_data The csv data. If you are using the REST API, you will need to invoke this method as a POST.
is_first_line_headers Set to Y if the first line of the CSV is the column headers.

Returned Values

The XML response is contained within a <tps_bulk_res> element.

Name Description
status Returns ok if the operation has succeeded, or error if an error has occurred; Returns the error_code for error details.
error_code

Returns the error code when the status is error. See below for error codes.

t2a_version_number The current API version number.

Example XML Response


<?xml version="1.0"?>
<tps_bulk_res>
	<mode>normal</mode>
	<status>ok</status>
	<t2a_version_number>3.2.3.1f</t2a_version_number>
	<transaction_id>wKVrW6dhYPMBEA0iQTuJ_u9YQx_L1fOvVqQ1AOboPS_U</transaction_id>
</tps_bulk_res> 

Command 'analyze'

Scans the uploaded CSV data and reports the number of unique telephone numbers found.

Mandatory Parameters

Name Description
api_key or javascript_key Use your API key if invoking via server-side XML or SOAP. If using JSON, generate a JavaScript key using the javascript_key method.
command Must be set to analyze
transaction_id The ID of the job, as created by create

Returned Values

The XML response is contained within a <tps_bulk_res> element.

Name Description
status Returns ok if the operation has succeeded, or error if an error has occurred; Returns the error_code for error details.
error_code

Returns the error code when the status is error. See below for error codes.

t2a_version_number The current API version number.
num_cols The number of columns in the CSV.
num_rows The number of rows in the CSV.
num_telephone The number of unique UK telephone numbers found..

Example XML Response


<?xml version="1.0"?>
<tps_bulk_res>
	<mode>normal</mode>
	<status>ok</status>
	<t2a_version_number>3.2.3.1f</t2a_version_number>
	<transaction_id>wKVrW6dhYPMBEA0iQTuJ_u9YQx_L1fOvVqQ1AOboPS_U</transaction_id>
	<num_rows>999</num_rows>
	<num_cols>8</num_cols>
	<num_telephone>752</num_telephone>
</tps_bulk_res> 

Command 'start'

Mandatory Parameters

Name Description
api_key or javascript_key Use your API key if invoking via server-side XML or SOAP. If using JSON, generate a JavaScript key using the javascript_key method.
command Must be set to start
transaction_id The ID of the job, as created by create

Returned Values

The XML response is contained within a <tps_bulk_res> element.

Name Description
status Returns ok if the operation has succeeded, or error if an error has occurred; Returns the error_code for error details.
error_code

Returns the error code when the status is error. See below for error codes.

t2a_version_number The current API version number.

Example XML Response


<?xml version="1.0"?>
<tps_bulk_res>
	<mode>normal</mode>
	<status>ok</status>
	<t2a_version_number>3.2.3.1f</t2a_version_number>
	<transaction_id>wKVrW6dhYPMBEA0iQTuJ_u9YQx_L1fOvVqQ1AOboPS_U</transaction_id>
</tps_bulk_res> 

Command 'progress'

Read the progress of the background processing of the appending. This might often be invoked as a client-side (Javascript) returning JSON.

Mandatory Parameters

Name Description
api_key or javascript_key Use your API key if invoking via server-side XML or SOAP. If using JSON, generate a JavaScript key using the javascript_key method.
command Must be set to progress
transaction_id The ID of the job, as created by create.
output Set to json if json is required.

Returned Values

The XML response is contained within a <tps_bulk_res> element.

Name Description
status Returns ok if the operation has succeeded, or error if an error has occurred; Returns the error_code for error details.
error_code

Returns the error code when the status is error. See below for error codes.

t2a_version_number The current API version number.
percentage The progress. When "100" the job has finished processing and you may proceed to the next stage.

Example JSON Response

{
	"transaction_id":"5nTrnrVDj6Q83GKuq68IdqAQnFcKYKCnoKNsJSVLiRzY",
	"percentage":"45",
	"mode":"normal",
	"status":"ok",
	"t2a_version_number":"2.2.2.3"
} 

Command 'finalise'

Use this command to commit to purchase the processed results. Providing that you have sufficient T2A credits, the price is deducted from your balance, and you may then download the processed results.

This command can be safely re-invoked; it will only charge once.

The results include the URL by which the processed CSV may be downloaded.

Mandatory Parameters

Name Description
api_key or javascript_key Use your API key if invoking via server-side XML or SOAP. If using JSON, generate a JavaScript key using the javascript_key method.
command Must be set to finalise
transaction_id The ID of the job, as created by create.

Optional Parameters

Name Description
output Set to json for a JSON response; the default response is XML. Not applicable to the SOAP API.
callback When using JSON, specify a JSONP wrapper in which the JSON response is to be wrapped.

Returned Values

The XML response is contained within a <tps_bulk_res> element.

Name Description
status Returns ok if the operation has succeeded, or error if an error has occurred; Returns the error_code for error details.
error_code

Returns the error code when the status is error. See below for error codes.

t2a_version_number The current API version number.
credit_used The number of credits used in order to execute the request.
download_url The full URL from which the processed CSV may now be downloaded.

Example XML Response


<?xml version="1.0"?>
<tps_bulk_res>
	<mode>normal</mode>
	<status>ok</status>
	<t2a_version_number>3.2.3.1f</t2a_version_number>
	<transaction_id>wKVrW6dhYPMBEA0iQTuJ_u9YQx_L1fOvVqQ1AOboPS_U</transaction_id>
	<download_url>http://t2a.co/rest/rest.aspx?method=csv_download&amp;job_id=2Kp9vcVWLYoisqKdADJx__3bf1LmVKVKEs6s01qOvZzz</download_url>
</tps_bulk_res> 

Error Codes

See the common error codes. There are no errors which are specific to this method.

Looking for the old documentation? Download it here (PDF format)

API Method List

< Back to T2A API Documentation

  1. Search for a person (person_search)
  2. Find people at an address (address_person)
  3. Search the UK Electoral Roll (electoral_roll)
  4. Search the Full UK Electoral Roll (full_electoral_roll)
  5. Person Verify (person_verify)
  6. Age verification (age_verification)
  7. Search for a residential telephone number (telephone_residential)
  8. Search for a business (business_search)
  9. Search for an address/postcode (address_search)
  10. Validate a telephone number (validate_telephone)
  11. Validate a mobile telephone number (validate_mobile_phone_number)
  12. Validate a credit card number (validate_credit_card)
  13. Validate an email address (validate_email)
  14. Validate a VAT number (validate_vat)
  15. TPS/CTPS check a telephone number (tps_full)
  16. TPS/CTPS checking a CSV file containing telephone numbers (tps_bulk)
  17. Find UK dialling codes (area_code)
  18. Find international dialling codes (country_dial)
  19. Geo-Code an address (geo_code)
  20. Reverse Geo-Code (reverse_geo_code)
  21. Find company details (company_details)
  22. Find director details (director_details)
  23. Get a company credit report (company_credit_report)
  24. Find a location from an IP address (ip_location)
  25. Send a text message (send_text_message)
  26. Check the bereavement register (deceased)
  27. Bulk check the bereavement register (deceased_bulk)
  28. Check company name availability (company_name_check)
  29. Download a company document (company_document_download)
  30. Generate a secure JavaScript key (javascript_key)
  31. Create an asynchronous job (job_create)
  32. Read the progress of an asynchronous job (job_progress)
  33. Telephone number appending (tele_append)
  34. View information about your account (client_info)