-
Notifications
You must be signed in to change notification settings - Fork 153
API
As of 1.0.0-alpha there is an API.
It is reachable at {swarmroot}/api.php
- JSON (recommended)
-
JSON-P (using
callback
parameter) - Serialized PHP
- Debug (see below)
See also http://json.org/ for a list of decoders in various programming languages.
Passes the JSON to a callback function (named in the callback
url parameter). This enables use of the TestSwarm API cross-domain in the web browser.
NB: For security reasons and to avoid abuse, the API does not allow logged-in sessions via JSONP.
Use of this format is discouraged for security and performance reasons. It is provided for compatibility with certain frameworks that require responses formatted with PHP's serialize()
function. Only use this if your framework requires it. Otherwise, even if you using the API in a PHP application, you are recommended to use the JSON format and use json_decode()
to decode it (instead of passing the serialized php format to unserialize
).
The debug format shows an HTML page instead with information about the request and then response is shown in a "pretty" format for human reading using PHPs var_dump
function. Together with the configuration options php_error_reporting
and db_log_queries
in the [debug]
section of testswarm.ini
, this is a very wide range debugging interface for API queries.
A full list of actions can be found in the ./inc/actions
directory of your TestSwarm installation. See the @actionXXX
comments above the doAction
methods in each class for more information about how the action should be used and what the required parameters and request methods are.