Create Multiple Synthetic API Monitoring Jobs API

This page describes the API used to create multiple Synthetic API monitoring jobs using a single API request.

Create Multiple API Monitoring Jobs

Creates multiple API monitoring jobs with the specified JSON payload.

Create Multiple API Monitoring Jobs

Resource URL

POST /v1/synthetic/api/schedule/batch

Request/Response Format

JSON

Example:

Request
JAVASCRIPT
{
"schedules": [
{
"scheduleRunConfigs": [
{
"rate": {
"value": 15,
"unit": "MINUTES"
},
"daysOfWeek": [
"SUN",
"WED",
"THUR",
"FRI",
"MON",
"TUES",
"SAT"
],
"timezone": "UTC"
}
],
"description": "jobUI",
"apiMetadata": {
"script": {
"contentType": "JAVASCRIPT",
"script": "// Javascript based API Monitoring Test\n\nconst assert = require(\"assert\");\n(async () => {\n    var response = await client.get(\"<URL>\");\n    assert.equal(response.statusCode, 200);\n    assert.equal(response.statusMessage, \"OK\");\n    for(var key in response.headers) {\n        console.log(`${key} : ${response.headers[key]}`);\n    }\n    assert.equal(response.body, \"response body\");\n})()"
}
},
"browserCodes": [
"API"
],
"chromeVersions": [],
"locationCodes": [
"M50"
],
"timeoutSeconds": 15,
"appKey": "appKey",
"composableConfig": {
"numBeforeConfirmedError": 0,
"resourceErrorDetection": {
"ignoreWhen": {
"resourceUrlContains": [],
"resourceMimeType": []
},
"onlyWhen": {
"resourceUrlContains": [],
"resourceMimeType": []
}
}
},
"performanceCriteria": {
"retestOnWarning": false,
"retestOnCritical": false,
"warningCriterion": [],
"criticalCriterion": []
}
}
]
}
Response
JSON
[
{
"status": "200",
"errorMessage": "null",
"scheduleId": "ID"
},
{
"status": "422",
"errorMessage": "timeout field value exceeds range",
"scheduleId": "null"
}
]

Request Parameters

Parameter Name Parameter Type Value Description Mandatory Request
scheduleRunConfigs - &#160; &#160; No
rate - &#160; &#160; No
value number

Minutes: 1 - 60

Hours: 1 - 24

Days: "null"

&#160; No
unit String Minutes, Hours, or Days &#160; No
daysOfWeek String "SUN", "MON", "TUES", "WED", "THUR", "FRI", "SAT" &#160; No
timeRange String &#160; Between hh:mm AM/PM to hh:mm AM/PM No
timezone String "UTC" GMT +/-hh:mm No
startTime String &#160; dd/mm/yyyy hh:mm AM/PM No
endTime String &#160; dd/mm/yyyy hh:mm AM/PM No
description String Job name Name of the job Yes
url String "null" or URL to monitor

The URL that you want to monitor.

When you use this parameter, the value of the script

No
script String

"null"

If you have a scripted job, specify the python-based selenium script used for simulating the user flow or behavior.

When you use this parameter, the value of the url

No
apiMetadata String Script object of the web monitoring job &#160; Yes
contentType String &#160; &#160; Yes
script String &#160; &#160; Yes
browserCodes String

Use the following Synthetic internal browser codes:

  • Chrome: Chrome
  • Internet Explorer: IE11
  • Firefox: Firefox
  • Mobile: Chrome.DeviceEmulation
&#160; No
chromeVersions String Chrome browser version 86 &#160; No
locationCodes String

Synthetic internal location codes of each agent location. See Location Codes.

&#160; Yes
timeoutSeconds Number &#160; &#160; No

appKey

String

Application key

You can get the application key from the Controller.

  1. Navigate to User Experience>API Monitoring.
  2. Hover over the collection name and click the copy icon to copy the Collection Key. The Collection Key is the Application Key.
Yes

networkProfile

String &#160; "name": "Native", "downloadKbps": 5000, "uploadKbps": 1000, "roundtripTimeMillis": 28, "packetLossPercent": 0, "isDefault": false No
composableConfig - &#160; You can use this parameter to configure:
  • Custom Retry
  • Availability Rules
No
numBeforeConfirmedError Number 0, 1, 2, 3, 5, or 10 Number of retries No
resourceErrorDetection - &#160; &#160; No
ignoreWhen - &#160; &#160; No
resourceUrlContains String Comma-separated list List of resource URLs No
resourceMimeType String &#160; &#160; No
onlyWhen - &#160; &#160; No
resourceUrlContains String Comma-separated list List of resource URLs No
resourceMimeType String &#160; &#160; No
deviceEmulationProfile String &#160; &#160; No
requestHeader String &#160; &#160; No
performanceCriteria - &#160; &#160; No
retestOnWarning Boolean true or false Re-test on warning event No
retestOnCritical Boolean true or false Re-test on critical event No
warningCriterion String &#160; &#160; No
criticalCriterion String &#160; &#160; No

Response Status Codes

200 Success
401 Unauthorized
402 Exceeded job limit
422 Validation failure
429 Throttled
500 Internal server error