T2A


Click here for a complete list of operations.

javascript_key

Generate a key to allow your web page to securely access T2A using Javascript.

Returns a secure key which can be safely embedded in dynamic HTML markup to allow JavaScript access to T2A functions.

You must specify a maximum lifetime for the key in minutes (up to 24 hours), and your website domain in which it will be used (e.g. www.mywebsite.com) and can optionally specify the remote IP address from which it can only be used (i.e. the user's IP address).

These security measures ensure that the JavaScript key can only be used in your website by your designated users.

Test

To test the operation using the HTTP POST protocol, click the 'Invoke' button.
Parameter Value
api_key:
client:
ip_address:
domain:
lifetime_minutes:

SOAP 1.1

The following is a sample SOAP 1.1 request and response. The placeholders shown need to be replaced with actual values.

POST /soap/t2a.asmx HTTP/1.1
Host: api.t2a.io
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "https://api.t2a.io/soap/javascript_key"

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <javascript_key xmlns="https://api.t2a.io/soap">
      <api_key>string</api_key>
      <client>string</client>
      <ip_address>string</ip_address>
      <domain>string</domain>
      <lifetime_minutes>string</lifetime_minutes>
    </javascript_key>
  </soap:Body>
</soap:Envelope>
HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <javascript_keyResponse xmlns="https://api.t2a.io/soap">
      <javascript_keyResult>
        <javascript_key>string</javascript_key>
        <ip_address>string</ip_address>
        <domain>string</domain>
        <lifetime_seconds>string</lifetime_seconds>
        <method_list>
          <string>string</string>
          <string>string</string>
        </method_list>
      </javascript_keyResult>
    </javascript_keyResponse>
  </soap:Body>
</soap:Envelope>

SOAP 1.2

The following is a sample SOAP 1.2 request and response. The placeholders shown need to be replaced with actual values.

POST /soap/t2a.asmx HTTP/1.1
Host: api.t2a.io
Content-Type: application/soap+xml; charset=utf-8
Content-Length: length

<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
  <soap12:Body>
    <javascript_key xmlns="https://api.t2a.io/soap">
      <api_key>string</api_key>
      <client>string</client>
      <ip_address>string</ip_address>
      <domain>string</domain>
      <lifetime_minutes>string</lifetime_minutes>
    </javascript_key>
  </soap12:Body>
</soap12:Envelope>
HTTP/1.1 200 OK
Content-Type: application/soap+xml; charset=utf-8
Content-Length: length

<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
  <soap12:Body>
    <javascript_keyResponse xmlns="https://api.t2a.io/soap">
      <javascript_keyResult>
        <javascript_key>string</javascript_key>
        <ip_address>string</ip_address>
        <domain>string</domain>
        <lifetime_seconds>string</lifetime_seconds>
        <method_list>
          <string>string</string>
          <string>string</string>
        </method_list>
      </javascript_keyResult>
    </javascript_keyResponse>
  </soap12:Body>
</soap12:Envelope>

HTTP GET

The following is a sample HTTP GET request and response. The placeholders shown need to be replaced with actual values.

GET /soap/t2a.asmx/javascript_key?api_key=string&client=string&ip_address=string&domain=string&lifetime_minutes=string HTTP/1.1
Host: api.t2a.io
HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length

<?xml version="1.0" encoding="utf-8"?>
<javascript_key_res xmlns="https://api.t2a.io/soap">
  <javascript_key>string</javascript_key>
  <ip_address>string</ip_address>
  <domain>string</domain>
  <lifetime_seconds>string</lifetime_seconds>
  <method_list>
    <string>string</string>
    <string>string</string>
  </method_list>
</javascript_key_res>

HTTP POST

The following is a sample HTTP POST request and response. The placeholders shown need to be replaced with actual values.

POST /soap/t2a.asmx/javascript_key HTTP/1.1
Host: api.t2a.io
Content-Type: application/x-www-form-urlencoded
Content-Length: length

api_key=string&client=string&ip_address=string&domain=string&lifetime_minutes=string
HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length

<?xml version="1.0" encoding="utf-8"?>
<javascript_key_res xmlns="https://api.t2a.io/soap">
  <javascript_key>string</javascript_key>
  <ip_address>string</ip_address>
  <domain>string</domain>
  <lifetime_seconds>string</lifetime_seconds>
  <method_list>
    <string>string</string>
    <string>string</string>
  </method_list>
</javascript_key_res>