Request fieldsRequests comprise HTTP URLs with parameters passed either in the query string, in the usual way, or as form data. The two can be mixed and matched to suit the application but all functions described here can be operated by the creation of simple HTML pages or manually created links. The call to the API will contain the following field plus any additional fields required by the command itself. Optional values not relevant to any specific commands are detailed here as well.
http://ws.simwood.com/REST.php?mode=BALA&token=6dac259d704ae993ec7d6fbc0d08c70e66b46288 Response fields
Example outputAccording to the ‘output’ field in the request, if any, results will come in one of four formats. An example of each for the BALA command is show below: XML<?xml version="1.0" encoding="utf-8"?><data><status>1</status><message>OK</message><results><account>939998</account><balance>10928.000</balance><currency>GBP</currency></results></data>JSON {"status":"1","message":"OK","results":{"account":"939998","balance":"10928.000","currency":"GBP"}}Seriala:3:{s:6:"status";s:1:"1";s:7:"message";s:2:"OK";s:7:"results";a:3:{s:7:"account";s:6:"939998";s:7:"balance";s:8:"10928.000";s:8:"currency";s:3:"GBP";}}Text[data]status=1message=OK[results]account=939998balance=10928.000currency=GBP |
Array
(
[status] => 1
[message] => OK
[results] => Array
(
[account] => 939998
[balance] => 10928.000
[currency] => GBP
)
)We would recommend XML format for general use. It is well formed and can easily be passed through an XSLT to yield almost any custom format you require.
The text format has limitations which may in the long-run make it more complicated than other formats, e.g. the nesting of values isn’t possible, but is simpler to read. The php format is easily readable by those familiar with PHP whilst serial outputs a serialised PHP array which can be accessed in a single command. JSON has the benefits of XML with single-command de-serialisation from most languages.
It should be noted however that as the output format is specified on a per request basis, you may choose to use different formats for different commands according to your intended use for the results.