Create a Schedule

You can find the information for creating a schedule for a test and multi test.

Create a Schedule for Test

API Explorer: /schedules

To schedule a test, you need the testId of the test you want to run on a schedule and build a cron string for the desired run schedule. For the sample code on the right, testId 1234567 has been scheduled with the cron schedule of 0 0 * * 1-5 (this schedule will run at midnight every Monday-Friday). To schedule your test, replace the testId 1234567 with the testId of your test and the cron attribute with your desired cron schedule.

The response for this API will provide a scheduleId, which will be needed for the scheduler APIs that follow.

Create a ScheduleCreate a Schedule for Test

curl 'https://a.blazemeter.com/api/v4/schedules' \
	-X POST \
  -H 'Content-Type: application/json' \
  --user 'api_key_id:api_key_secret' \
  -d '{"cron":"0 0 * * 1-5","testId":1234567}'

Create a Schedule for Test Request Attributes

Attributes

  • cronstring

    required

    The cron schedule you want to use for the test

  • testIdinteger

    required

    Test Only

    The testId of the test

Create a ScheduleCreate a Schedule for Test POST Body (JSON)

{
	"cron": "0 0 * * 1-5",
	"testId": 1234567
}

Create a Schedule for Test Response Attributes

To see a breakdown of the attributes, refer to The Schedule Object section.

Response201 Created

{
    "api_version": 4,
    "error": null,
    "result": {
        "id": "5c83e5610bd29075e16b2794",
        "cron": "0 0 * * 1-5",
        "nextRun": 1552262400,
        "enabled": true,
        "type": "testRun",
        "created": 1552147809,
        "updated": 1552147809,
        "testId": 1234567,
        "createdById": 123456
    }
}

Create a Schedule for Multi-Test

API Explorer: /schedules

To schedule a test, you need the collectionId of the test you want to run on a schedule and build a cron string for the desired run schedule. For the sample code on the right, collectionId 10027459 has been scheduled with the cron schedule of 0 0 * * 1-5 (this schedule will run at midnight every Monday-Friday). To schedule your test, replace the collectionId 10027459 with the collectionId of your test and the cron attribute with your desired cron schedule.

The response for this API will provide a scheduleId, which will be needed for the scheduler APIs that follow.

Create a ScheduleCreate a Schedule for Multi-Test

curl 'https://a.blazemeter.com/api/v4/schedules' \
	-X POST \
	-H 'Content-Type: application/json' \
  --user 'api_key_id:api_key_secret' \
  -d '{"cron":"0 0 * * 1-5","testCollectionId":12345678}'

Create a Schedule for Multi-Test Request Attributes

Attributes

  • cronstring

    required

    The cron schedule you want to use for the test

  • testCollectionIdinteger

    required

    Multi-Test Only

    The collectionId of the multi test

Create a ScheduleCreate a Schedule for Multi-Test POST Body (JSON)

{
	"cron": "0 0 * * 1-5",
	"testCollectionId": 12345678
}

Create a Schedule for Multi-Test Response Attributes

To see a breakdown of the attributes, refer to The Schedule Object section.

Response201 Created

{
    "api_version": 4,
    "error": null,
    "result": {
        "id": "5c83ec4a7b12f573685c5f36",
        "cron": "0 0 * * 1-5",
        "nextRun": 1552262400,
        "enabled": true,
        "type": "testRun",
        "created": 1552149578,
        "updated": 1552149578,
        "testCollectionId": 12345678,
        "createdById": 123456
    }
}