The TransVirtual API supports an optional return format parameter format=json. Note that json is the default response format, but xml is also available.

All of the TransVirtual API also supports jsonp which is the json format with a callback specified, such as:

format=json&callback=[callback_method]

  • All API requests should be against the domain https://api.transvirtual.com.au or https://api.transvirtual.io

  • The valid response in json or xml formats will be sent along with the HTTP Response Status Code. In normal operation the HTTP Response Status Code will be identical to the StatusCode value, with the StatusText offering more detail to any 'non' 200 HTTP Response Status Code issues.

  • If the StatusCode is not 200, only StatusCode and StatusText are guaranteed to be present and valid.

  • The Data field will contain the valid response and will exist for all 200 reponses, but not all API requests will populate this field with data. Review the documentation for each API method for expected response data results.

  • The TransactionId field will return the ID for this request. A value for this field will be returned for all responses that make it to the TransVirtual API, even if the response contains a error status.

  • If you have requested data in JSON, the API expects the endpoint to supply any required data in the same format. The only exception is the format and callback query string parameters.

Example Responses:

json

{"TransactionID":451154, "StatusCode":200, "StatusText":"OK", "Data":{....}}

json

{"TransactionID":451154, "StatusCode":403, "StatusText":"INVALID AUTH", "Data":{}}

json

{"TransactionID":451154, "StatusCode":400, "StatusText":"SSL Required", "Data":{}}

jsonp

callback_method({"TransactionID":451154, "StatusCode":200, "StatusText":"OK", "Data":{....}})

xml