Sign up Login

Generate a Secure JavaScript Key

API Method: javascript_key

Description

Returns a secure key which can be used in your web pages to provide client-side access to T2A methods using JavaScript (and usually JSON).

Mandatory Parameters

Name Description
api_key Use your API key. Note that this method may only be invoked server-side.
domain Enter your domain (the request host parameter) on which the temporary Javascript key will be used.
lifetime_minutes The lifetime of the key; the maximum is 60 minutes.

Optional Parameters

Name Description
ip_address The remote IP address of the final user; if specified, the JavaScript key will only function for this IP address.

Returned Values

The XML response is contained within a <javascript_key_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.
javascript_key The key which can now be used with client-side JavaScript, to connect to our servers. Note that this key is alphanumeric, plus the _ and - characters.

Error Codes

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

Example XML Response


<?xml version="1.0"?>
<javascript_key_res>
  <mode>normal</mode>
  <status>ok</status>
  <t2a_version_number>3.2.5.3</t2a_version_number>
  <javascript_key>dS4g8CEZo_fpOGHGx7R_OUFksg5FBnuFXpgpFWhoatCF5kKk0ydZHSS3DtrP6iPtQMT0who7GgoQ362RQVxERtT</javascript_key>
</javascript_key_res>

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)