The API can logical be divided in three sections: running jobs, monitor job state and reading results.

Running Monitor Reading

Command line

Using curl is a great way to explore the API from the command line:

curl -XPOST http://chemgps.bmc.uu.se/batchelor/api/json/queue -d '{"sort":"started","filter":"crashed"}'

Target method

The method name either be encoded in the URL (see previous example) or inside the JSON payload:

curl -XPOST http://chemgps.bmc.uu.se/batchelor/api/json/index -d '{"method":"queue","sort":"started","filter":"crashed"}'


All responses (except from fopen()) is JSON encoded and contains at least the status member that is either 'success' or 'failure'. A success response contains the additional 'result' member containing the requested data:

    "status": "success",
    "result": "..."

A failed request contains the additional 'message' and 'code' members. The code is internal and can be ignored.

    "status": "failure",
    "message": "The task processor vorbis is missing",
    "code": 0

The HTTP status code is always 200. If you get something else, its origin is not from this system.

Modify output

A couple of extra parameters can be passed that affects how the JSON response gets encoded:

curl -XPOST http://chemgps.bmc.uu.se/batchelor/api/json/queue?pretty=1&escape=0&numeric=1&unicode=0&fraction=1 -d '{"sort":"started","filter":"crashed"}'

These options can be passed using POST or GET (as in the example above). The example also shows the value to enable/disable that particular option.