Rest Project

This is the How Restbird organize cases and their running result history in Rest Project. rest project org

NOTE: All API calls need to include Basic Authentication Header, or will receive 401 Unauthorized error. Check Restbird API Authentication for more information.

Rest Project

Get all rest projects and cases

  GET  /v1/rest/all?category=rest&dironly=false

Get APIs of specific case by page

  GET  /v1/rest/api/all?project={{rest_case_path}}&page={{page_num}}&entrylimit={{page_size}}

The syntax of {{rest_case_path}} is [path of project directory]/[case name]

Run APIs of specific case

  POST  /v1/rest/run
  • Request Body (raw)
  {
    "casepath":"{{rest_case_path}}",
    "apis":["api0","api1", "apiN"]
  }

If Environment variable is used, before calling this API, make sure Environment has been binded with this case by calling #bind-case-with-environment

When this API been invoked, Restbird will create a running task in backend and put it into a queue, then return the id of the task. This id will be used in the following requests to fetch status and result.

Get case running status of the specific test history

  POST  /v1/rest/runresult
  • Request Body (raw)
  {
    "project":"{{rest_case_path}}",
    "id":"{{rest_history_id}}",
    "immediatereturn": false
  }

{{rest_history_id}} id the id returned from last API

immediateReturn param set if the API will return immediately when the specific test hasn’t finished. If set to true, API will return with “unfinished”, client program need to recheck later; if set to false, API will wait for 60 seconds and kill the test process if it can’t finish within that time frame

Get console log of specifc test history

  GET  /v1/rest/his/console?project={{rest_case_path}}&id={{rest_history_id}}

Get value of variables of specifc test history

  GET  /v1/rest/his/vars?project={{rest_case_path}}&id={{rest_history_id}}&apiid={{api_id}}

{{api_id}} is the order of the specific API in that case, starting from 0, so the first API is api0

Get test result of all APIs of specific case by page

  GET  /v1/rest/his/allapis?project={{rest_case_path}}&id={{rest_history_id}}&page={{page_num}}&entrylimit={{page_size}}

Get respnse body of single API of the specific test history

  GET  /v1/rest/his/body?project={{rest_case_path}}&id={{rest_history_id}}&apiid={{api_id}}

Stop running the specific test

  GET  /v1/rest/his/stop?project={{rest_case_path}}&id={{rest_history_id}}

Delete test history

  GET  /v1/rest/his/del?project={{rest_case_path}}&id={{rest_history_id}}

Environment Variable

Bind case with Environment

  GET  /v1/rest/bindenv?category=rest&project={{rest_case_path}}&env={{env}}

Get all environment variables

  GET  /v1/rest/env/all

Add Environment

  GET /v1/rest/env/add?env={{env}}

Update environment variables

  POST /v1/rest/env/update
  • Request Body (raw)
  {
    "name":"{{env}}",
    "envs":[
             {
             	"key":"{{var_key}}",
                "value":{{var_value}},
                "disabled":false
    	     }
    	   ]
  }

Delete environment

  GET  /v1/rest/env/del?env={{env}}

Global Variable

Get all global variables

  GET  /v1/rest/global/all

Add global variable

  POST /v1/rest/global/add
  • Request Body (raw)
  {
    "key":"global_var_key",
    "value":"global_var_value"
  }

Update global variable

  POST  /v1/rest/global/update
  • Request Body (raw)

    {
     "key":"global_var_key",
     "value":"global_var_value"
    }

Delete global variable

  GET  /v1/rest/global/del?key={{global_var_key}}