Mock Server

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

Get all mock server projects and cases

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

Get specific mockServer case

  GET  /v1/mock/get?project={{mock_case_path}}

This API returns the running status of mock server

Set listening port for specific mock server

  POST  /v1/mock/update
  • Request Body (raw)
  {
    "casepath":"{{mock_case_path}}",
    "listenport":{{port_num}},
    "numrecords":{{record_num}}
  }

Start specific mockServer case

  GET  /v1/mock/start?project={{mock_case_path}}

After this API return success, we recommand to call Get specific mockServer case API to check the status of the mock server, because for some reason like “the listening port being used by other process”, or the mock server failed after start up, Restbird cannot detecte it automatically. To diagnose call Get console log of specific mock server case API.

Stop specific mockServer case

  GET  /v1/mock/stop?project={{mock_case_path}}

Get console log of specific mockServer case

  GET  /v1/mock/console?project={{mock_case_path}}

Get state of specific mockServer case

  GET  /v1/mock/state?project={{mock_case_path}}