This page describes the API used to create and configure a Synthetic API monitoring job.

Create an API Monitoring Job

Creates a new API monitoring job with the specified JSON payload.

Resource URL

POST /v1/synthetic/api/schedule

Request/Response Format

JSON

Example

{
  "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": []
  }
}
JSON
{
  "_id": "job_id",
  "version": 1,
  "scheduleRunConfigs": [
    {
      "rate": {
        "value": 1,
        "unit": "MINUTES"
      },
      "daysOfWeek": [
        "WED",
        "FRI",
        "SUN",
        "SAT",
        "TUES",
        "MON",
        "THUR"
      ],
      "timezone": "UTC"
    }
  ],
  "userEnabled": true,
  "systemEnabled": true,
  "type": "ALL_BROWSERS",
  "rate": {
    "value": 15,
    "unit": "MINUTES"
  },
  "daysOfWeek": [
    "WED",
    "FRI",
    "SUN",
    "SAT",
    "TUES",
    "MON",
    "THUR"
  ],
  "timezone": "UTC",
  "description": "https://appdynamics.com",
  "appKey": "appKey",
  "scheduleMode": "NONE",
  "url": "https://appdynamics.com",
  "browserCodes": [
    "Chrome"
  ],
  "chromeVersions": [
    "86"
  ],
  "locationCodes": [
    "BOM",
    "M50"
  ],
  "failOnPageError": true,
  "captureVisualMetrics": true,
  "simulateMobileBrowser": false,
  "networkProfile": {
    "name": "Native",
    "downloadKbps": 5000,
    "uploadKbps": 1000,
    "roundtripTimeMillis": 28,
    "packetLossPercent": 0,
    "isDefault": false
  },
  "timeoutSeconds": 15,
  "state": {
    "lastFireTime": "2022-04-06T05:57:16.000Z",
    "nextFireTime": "2022-04-06T06:00:16.000Z"
  },
  "projectedUsage": {
    "projectedDailyRuns": 2880,
    "projectedMonthlyRuns": 86400
  },
  "performanceCriteria": {
    "retestOnWarning": false,
    "retestOnCritical": false,
    "criterion": []
  },
  "composableConfig": {
    "numBeforeConfirmedError": 0,
    "resourceErrorDetection": {
      "ignoreWhen": {
        "resourceUrlContains": [],
        "resourceMimeType": []
      },
      "onlyWhen": {
        "resourceUrlContains": [],
        "resourceMimeType": []
      }
    }
  },
  "created": "2022-04-05T05:30:36.426Z",
  "updated": "2022-04-05T05:30:36.426Z"
}
JSON

Request Parameters

Parameter NameParameter TypeValueDescriptionMandatory Request
scheduleRunConfigs-

No
  rate-

No
    valuenumber

Minutes: 1 - 60

Hours: 1 - 24

Days: "null"


No
    unitStringMinutes, Hours, or Days
No
  daysOfWeekString"SUN", "MON", "TUES", "WED", "THUR", "FRI", "SAT"
No
  timeRangeString
Between hh:mm AM/PM to hh:mm AM/PMNo
  timezoneString"UTC"GMT +/-hh:mmNo
  startTimeMillisString

No
  endTimeMillisString

No
descriptionStringJob nameName of the jobYes
urlString"null" or URL to monitor

The URL that you want to monitor.

When you use this parameter, the value of the script parameter must be null.

No
scriptString

"null" or python-based selenium script to monitor

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 parameter must be null.

No
apiMetadataStringScript object of the API monitoring job 
Yes
  contentTypeString

Yes
  scriptString

Yes
browserCodesString

Use the following Synthetic internal browser codes:

  • Chrome: Chrome
  • Internet Explorer: IE11
  • Firefox: Firefox
  • Mobile: Chrome.DeviceEmulation

No
chromeVersionsStringChrome browser version 86
No
locationCodesString

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


Yes
timeoutSecondsNumber

No
appKeyStringApplication 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
 "name": "Native",
 "downloadKbps": 5000,
 "uploadKbps": 1000,
 "roundtripTimeMillis": 28,
 "packetLossPercent": 0,
 "isDefault": false
No
composableConfig-
You can use this parameter to configure: 
  • Custom Retry
  • Availability Rules
No
  numBeforeConfirmedErrorNumber0, 1, 2, 3, 5, or 10Number of retriesNo
  resourceErrorDetection-

No
    ignoreWhen-

No
      resourceUrlContainsStringComma separated listList of resource URLsNo
      resourceMimeTypeString

No
    onlyWhen-

No
      resourceUrlContainsStringComma separated listList of resource URLsNo
      resourceMimeTypeString

No
  deviceEmulationProfileString

No
  requestHeaderString

No
performanceCriteria-

No
  retestOnWarningBooleantrue or falseRe-test on warning eventNo
  retestOnCriticalBooleantrue or falseRe-test on critical eventNo
  warningCriterionString

No
  criticalCriterionString

No

Location Codes

Cloud LocationCodes
Azure
AmsterdamNET
San AntonioSAN
MelbourneASV
TorontoCAC
ChennaiSIC
AWS
MumbaiBOM
DublinDUB
FrankfurtFRA
Sao PauloGRU
Hong KongHON
AshburnIAD
SeoulICN
LondonLON
BoardmanM50
MilanMIL
MontrealMON
TokyoNRT
ParisPAR
San FranciscoSFO
SingaporeSIN
SydneySYD

Response Status Codes

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