Follow

Schedule a Test

Description

This BlazeMeter API enables you to schedule any available test or multi-test in advance. This API call includes parameters to identify the user, Test/Multi-test and the scheduling configuration on Cron format. Also, when entering the scheduled time of your Test, this will be set in UTC / GMT timezone. 

URL

https://a.blazemeter.com/api/v4/schedules

Request Headers

Parameter Description
x-api-key Identifies the user. How to get the API Key?
Content-Type application/json

Request Parameters

Parameter Description
cron Cron syntax execution line
note Add comments - Optional
testId / collectionId Identifies the test. How to get the Test ID?


cURL

curl -X POST https://a.blazemeter.com/api/v4/schedules -H "Content-Type: application/json" -H "x-api-key: 62f7f52eb342c3ec1e31" -d '{"cron":"* * 2 3 *", "testId":" 1328776}'

Python

import requests

url = "https://a.blazemeter.com/api/v4/schedules"

payload = "{\n        \"cron\": \"* * 2 3 *\",\n        \"testId\": 1328776\n}"
headers = {
    'x-api-key': "62f7f52eb342c3ec1e31;,
    'content-type': "application/json",
    'cache-control': "no-cache",
    }

response = requests.request("POST", url, data=payload, headers=headers)

print(response.text)

Example Response

{
  "api_version": 4,
  "error": null,
  "result": {
    "id": "aab6ca2bb2j645132c367b23e5",
    "cron": "* * 2 3 *",
    "nextRun": 1488412800,
    "enabled": true,
    "type": "testRun",
    "created": 1488374315,
    "updated": 1488374315,
    "testId": 1328776,
    "createdById": 2483174
  }
}



Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.