Contact Dotcom-Monitor support team to receive access to this Web API functionality.

Request URL

PUT https://api.dotcom-monitor.com/config_api_v1/tasks

 

Request Example
https://api.dotcom-monitor.com/config_api_v1/tasks?Device_Id=328242&Task_Type_Id=21&Timeout=55000&Name=My Script&RequireRepeatVisit=true&WriteVideoOnEachMonitoring=true&DisableHttpProxy=false&DisableVideoRecording=true&DisableScreenshots=true&AbortOnError=true&DNSResolveMode=External DNS Server&DNSserverIP=112.115.124.55&CustomDNSHosts=asa.com=112.115.124.77;cnn.com=112.115.124.78

Query Parameters

Field Type Required/Optional Description
Timeout

int32

optional

Contains task execution timeout in ms.
Device_Id

int32

required

The unique device id.

Example:
"Device_Id": 8692
Task_Type_Id

int32

required

The type of the task.
Name

string

optional

The task description.
RequireRepeatVisit

boolean

optional

Defines the state of the Simulate Return Visitor flag.

POSSIBLE VALUES:

  • true – monitoring is executed to simulate a frequent visitor who already has elements from the page cached.
  • false –  a new visitor is simulated for each run.
WriteVideoOnEachMonitoring

boolean

optional

Defines the state of the Record Video on Each Run option.

POSSIBLE VALUES:

  • true – a video record is created for each monitoring session.
  • false –  the system records a video on the first session of a day that errors or on the first error detected from a location.
DisableHttpProxy

boolean

optional

Allows to activate the proxy to send monitoring requests through a proxy or switch back to direct requests.
DisableVideoRecording

boolean

optional

Allows to disable the video recording feature.
DisableScreenshots

boolean

optional

Allows to disable the screenshots feature.
AbortOnError

boolean

optional

Indicates if the Abort Script on First Error option is activated.

POSSIBLE VALUES:

  • true – script execution will be stopped on the first monitoring error.
  • false – script execution will continue till the timeout is reached.
DNSResolveMode

boolean

optional

POSSIBLE VALUES:

  • Device Cached
  • Non Cached
  • TTL Cached
  • External DNS Server

For detailed explanation, see the DNS Mode Option article.

DNSserverIP

string

0ptional

The field for a custom DNS server IP address. For detailed explanation, see the DNS Mode Option article.
CustomDNSHosts

string

optional

Contains the list of IP address – host name pairs that are used to set up mapping of IP addresses to host names.

 

Request Body

Dotcom-Monitor API accepts binary files uploaded with a request body. To upload an ES script along with your request to Dotcom-Monitor:

  1. Create or edit an EveryStep script using EveryStep Scripting Tool.
  2. Download the script to your computer and save to a dmuv/dmes file.
  3. In an API client, select to send the dmuv/dmes file as a binary file in the request body. If your API client does not support the binary method, use an alternative approach.
Request Example
curl --location --request PUT "https://api.dotcom-monitor.com/config_api_v1/tasks?Device_Id=16826&Task_Type_Id=21&Timeout=55000&Name=uploaded_dmes_script" ^
--header "Content-Type: application/octet-stream" ^
--header "Cookie: DANA-AUTH-API-COOKIE=7efad88951954e61a1235f43219882f34; DANA-AUTH-COOKIE=21c34cc69cdd4123448eaa5c519a824e" ^
--data "@/C:/Users/dm_admin/ES_Scripts/everystep-script.dmes"

Uploading ES Script as Base64 Encoded Data

If your API client does not support the binary method, you can upload your ES script to Dotcom-Monitor as a JSON body parameter in the Base64 format. Note that in this case, all request parameters should be passed in the request body (not in the query).

Request URL

You can upload an ES script as Base64 by using 2 methods:

PUT https://api.dotcom-monitor.com/config_api_v1/tasks
POST  https://api.dotcom-monitor.com/config_api_v1/tasks?verb=PUT

Header Parameters

Content-Type: application/json

JSON Body Example

{ 
    "Device_Id": 3153, 
    "Task_Type_Id": 21, 
    "Name": "dotcom-monitor.com", 
    "Timeout": 13, 
    "base64dmuv": "AAEAAAD/////AQAAAAAAAAAEAQAAAAxTeXN0ZW0uSW50MzIBAAAAB21fdmFsdWUACAIAAAALAAEAAAD/////AQAAAAAAAAAMAgAAAERfT1FMX0R5bmFtaWNfLCB.......1bHR1cmU9bmV1dHJh"
    "RequireRepeatVisit": true,
    "WriteVideoOnEachMonitoring": true,
    "DisableHttpProxy": false,
    "DisableVideoRecording": true,
    "DisableScreenshots": true,
    "AbortOnError": true,
    "DNSResolveMode": "External DNS Server",
    "DNSserverIP": "112.115.124.55",
    "CustomDNSHosts": "asa.com=112.115.124.77"
    }

Body Parameters

Required JSON parameters are provided below. To add more parameters to the body, please see the description of the fields in the API: UserView Task JSON Sample.

Field Type Required/Optional Description
base64dmuv string required Contains ES script in the Base64 format.

Please see the guideline to convert EveryStep script into Base64.

Device_Id

int32

required

The unique device id.

Example:
"Device_Id": 8692
Task_Type_Id

int32

required

The type of the task.

 

To convert the script into the Base64 format, you will need to import the script from the tool to a *.dmuv (ES Desktop) or *.dmes (ES Web) file first. Please follow the steps below:

  1. Create or edit an EveryStep script using EveryStep Scripting Tool.
  2. Download the script to your computer and save to a dmuv/dmes file.
  3. Use an encoder to convert the dmuv/dmes file into Base64 format.
  4. Copy an encoded content into the base64dmuv parameter of your JSON request.

Alternatively, if you have any trouble converting the script file into Base64, you can download our Base64 encoder here. Once downloaded, use the encoder to convert the ES file as described below:

  1. Open the command line and provide a path to the encoder .exe file encoding_checker.exe.
  2.  Provide the full path to the downloaded dmuv/dmes file as an argument (e.g., “g:\Temp9\login_check.dmuv”).
  3. To save a converted script into a file, provide a path to the file.

Success Response

Example Response
{
    "Success":true,
    "Result":17989
}
Field

Type

Description

Result

int32

The unique id for the task. Use the Id in the Edit operation.
[/su_table