General routes

Some general routes available on the API can be used to get a “raw” low-level access to the Pythia platform. For example, it is possible to get health information about the Pythia backbone or to directly execute a task.

Health information

One route is available to get information about the health of the Pythia backbone and this API server itself. Basic information about the running status of different services can be obtained.

GET /api/health

Health information about the Pythia backbone and this API server.

Example request

GET /api/health HTTP/1.1
Host: example.com
Accept: application/json

Example response

HTTP/1.1 200 OK
Content-Type: application/json

{
  "running": true
}
Request Headers:
 
Response Headers:
 
Response JSON Object:
 
  • running (boolean) – Pythia backbone running status
Status Codes:

Task execution

One route is available to ask to the Pythia backbone for the execution of a single task. The input and the output of the tasks are raw strings whose precise specification and format are defined for each task. The result of the execution, containing the Pythia status and the output, is either directly sent in the body of the response of this request (sync mode) or is sent later on to a callback URL that has been specified (async mode). For the latter case, the callback URL must point to a publicly available POST route.

POST /api/execute

Execute a task on the Pythia backbone.

Example request

POST /api/execute HTTP/1.1
Host: example.com
Accept: application/json
Content-Type: application/json

{
  "tid": "hello-world"
}

Example response

HTTP/1.1 200 OK
Content-Type: application/json

{
  "tid": "hello-world",
  "status": "success",
  "output": "Hello World!"
}
Request Headers:
 
Query Parameters:
 
  • async (boolean) – whether results are directly sent in the response of the request or later to a callback URL (optional, default: false)
Request JSON Object:
 
  • tid (string) – the identifier of the task to execute
  • input (string) – the input for the task (optional)
  • callback (string) – the callback URL to use for async mode (optional)
Response Headers:
 
Response JSON Object:
 
  • tid (string) – the identifier of the executed task
  • status (string) – the Pythia status of the execution
  • output (string) – the output created by the task execution
Status Codes:
  • 200 OK – task submitted for execution
  • 400 Bad Request – bad request (missing parameters, wrong parameter type, task not existing)