To access all DXI API interfaces, all requests need to have an access token which will authorize requests for a particular account for a fixed period of time. By default these requests are also restricted to the internet address that requests the token. The API url to manipulate these tokens is located at: https://api.dxi.eu/token.php The Token API has a number of available functions. The request arguments can all be passed as HTTP POST or GET variables: RESULT The response from the API can be formatted in either JSON or XML format. The default is JSON but this can be modified by the format argument. format: xml or json The API will output a number of optional values depending on the request made. success: Did the request succeed. value: true or false (JSON) | 1 or 0 (XML) error: If the request failed, this field will contain a description of the fault. Example JSON return: {"success":true,"token":"bd932b769fc7263316345627d0a9ef3b8f8d1f8d","expire":1307975676} Example XML return: <result> <success>1</success> <token>bd932b769fc7263316345627d0a9ef3b8f8d1f8d</token> <expire>1307975676</expire> </result>
Obtain a Token
This will return a new token if none exists or a previous token has expired. If a valid token already exists it will return the current details. Currently all tokens are valid for a 12 hour period but this is subject to change. By default the get request authorizes the ip address that sends the authentication request. This can be modified by sending the optional address argument set to the required ip address. This is typically used when a central application server needs to generate tokens for client end-point machines, e.g. ajax code. action: get arguments: username password address token.php?action=get&username=...&password=... Returns: token: The token id value expire: The timestamp of when the token expires. This is in Unix timestamp format, the number of seconds since the Unix Epoch (January 1 1970 00:00:00 GMT)
Validate a Token
Check to see if the specified token is still valid or not. action: validate arguments: token token.php?action=validate&token=... Returns: expire: The timestamp of when the token expires.
Delete a Token
Unauthorize an existing token. action: delete arguments: token token.php?action=delete&token=...
Change Password
Change the password for the given account. A valid token must be provided for the request to succeed. action: newpass arguments: password token token.php?action=newpass&password=...&token=...