DataTrue Management API (1.0.0)

Download OpenAPI specification:Download

Introduction

The DataTrue management API provides a REST based interface to interact with the following resources:

  • Users
  • Accounts
  • Suites
  • Draft tags
  • Tests
  • Steps
  • Tag validations
  • Data layer validations

Authentication

The Management API requires an API key to be provided in the Authorization header. The API key used to access the Management API can be found within your User Profile.

User

Retrieve the current user's profile

Retrieve the user profile for the user associated with the provided API key

Authorizations:
API Key

Responses

Response samples

Content type
application/json
{
  • "id": 1,
  • "name": "John Smith",
  • "time_zone": "Melbourne",
  • "utc_offset": "+11:00",
  • "created_at": "2020-01-01T01:01:01.000Z",
  • "updated_at": "2020-01-01T01:01:01.000Z"
}

Account

Retrieve a listing of accounts

Retrieve a listing of all accounts you have access to

Authorizations:
API Key

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Retrieve an account

Retrieve an account for a given account ID

Authorizations:
API Key
path Parameters
accountId
required
string

ID of the account to retrieve the suites for

Responses

Response samples

Content type
application/json
{
  • "id": 1,
  • "name": "My Account",
  • "steps_total": 1000,
  • "steps_used": 0,
  • "created_at": "2020-01-01T01:01:01.000Z",
  • "updated_at": "2020-01-01T01:01:01.000Z"
}

Suite

Retrieve a listing of suites

Retrieve a listing of all suites in a given account

Authorizations:
API Key
path Parameters
accountId
required
string

ID of the account to retrieve the suites for

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Create a suite

Create a suite in a given account

Authorizations:
API Key
path Parameters
accountId
required
string

ID of the account to create the suite in

Request Body schema: application/json
name
required
string

Name of the suite

description
string

Description for the suite

enabled
boolean
Default: true

Whether the suite is enabled

suite_type
string
Default: "web"
Enum: "web" "mobile_app"

Type of the suite. Available values:

  • web - Web
  • mobile_app - Mobile
persona_id
number

ID of the default persona for the suite

restart_between_tests
boolean
Default: false

Whether the browser should be restarted between tests when run as a suite

excluded_domains
Array of strings

A list of domains to be excluded from sensitive data detection

sensitive_data_setting
string
Default: "fail_when_detected"
Enum: "disabled" "fail_when_detected" "pass_when_detected"

How sensitive data should be detected for the suite. Available values:

  • disabled - no sensitive data detection occurs
  • fail_when_detected - fail the test when sensitive data is detected
  • pass_when_detected - pass the test when sensitive data is detected
object (Variables)

Variables that are able to be referenced throughout test configs

Responses

Request samples

Content type
application/json
{
  • "name": "Welcome to DataTrue",
  • "description": "This is a suite of example tests",
  • "suite_type": 0,
  • "persona_id": 1,
  • "restart_between_tests": false,
  • "excluded_domains": [
    ],
  • "sensitive_data_setting": "disabled"
}

Response samples

Content type
application/json
{
  • "suite": {
    }
}

Retrieve a suite

Retrieve the suite with the given suite ID

Authorizations:
API Key
path Parameters
suiteId
required
string

ID of the suite to retrieve

Responses

Response samples

Content type
application/json
{
  • "id": 1,
  • "name": "Welcome to DataTrue",
  • "description": "This is a suite of example tests",
  • "suite_type": 0,
  • "persona_id": 1,
  • "restart_between_tests": false,
  • "excluded_domains": [
    ],
  • "sensitive_data_setting": "disabled",
  • "tests": [
    ],
  • "created_at": 1530228858,
  • "updated_at": 1530228858
}

Update a suite

Update the suite with the given suite ID

Authorizations:
API Key
path Parameters
suiteId
required
string

ID of the suite to update

Request Body schema: application/json
name
required
string

Name of the suite

description
string

Description for the suite

enabled
boolean
Default: true

Whether the suite is enabled

suite_type
string
Default: "web"
Enum: "web" "mobile_app"

Type of the suite. Available values:

  • web - Web
  • mobile_app - Mobile
persona_id
number

ID of the default persona for the suite

restart_between_tests
boolean
Default: false

Whether the browser should be restarted between tests when run as a suite

excluded_domains
Array of strings

A list of domains to be excluded from sensitive data detection

sensitive_data_setting
string
Default: "fail_when_detected"
Enum: "disabled" "fail_when_detected" "pass_when_detected"

How sensitive data should be detected for the suite. Available values:

  • disabled - no sensitive data detection occurs
  • fail_when_detected - fail the test when sensitive data is detected
  • pass_when_detected - pass the test when sensitive data is detected
object (Variables)

Variables that are able to be referenced throughout test configs

Responses

Request samples

Content type
application/json
{
  • "name": "Welcome to DataTrue",
  • "description": "This is a suite of example tests",
  • "suite_type": 0,
  • "persona_id": 1,
  • "restart_between_tests": false,
  • "excluded_domains": [
    ],
  • "sensitive_data_setting": "disabled"
}

Response samples

Content type
application/json
{
  • "suite": {
    }
}

Delete a suite

Delete the suite with the given suite ID

Authorizations:
API Key
path Parameters
suiteId
required
string

ID of the suite to delete

Responses

Draft Tag

Retrieve a listing of draft tags

Retrieve a listing of all draft tags in a given suite

Authorizations:
API Key
path Parameters
suiteId
required
string

ID of the suite to retrieve the draft tags for

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Create a draft tag

Create a draft tag in a given suite

Authorizations:
API Key
path Parameters
suiteId
required
string

ID of the suite to create the draft tag in

Request Body schema: application/json
name
string

Name of the draft tag

description
string

Description for the draft tag

initializing_url
string

URL to visit before the start of a test

hostname
string

Hostname of requests to process

pathname
string

Pathname of requests to process

find
string

Text to search for

replace
string

Text to replace

Responses

Request samples

Content type
application/json
{
  • "name": "string",
  • "description": "string",
  • "initializing_url": "string",
  • "hostname": "string",
  • "pathname": "string",
  • "find": "string",
  • "replace": "string"
}

Response samples

Content type
application/json
{
  • "draft_tag": {
    }
}

Retrieve a draft tag

Retrieve the draft tag with the given draft tag ID

Authorizations:
API Key
path Parameters
draftTagId
required
string

ID of the draft tag to retrieve

Responses

Response samples

Content type
application/json
{
  • "name": "string",
  • "description": "string",
  • "initializing_url": "string",
  • "hostname": "string",
  • "pathname": "string",
  • "find": "string",
  • "replace": "string",
  • "id": 0,
  • "suite_id": 0
}

Update a draft tag

Update the draft tag with the given draft tag ID

Authorizations:
API Key
path Parameters
draftTagId
required
string

ID of the draft tag to update

Request Body schema: application/json
name
string

Name of the draft tag

description
string

Description for the draft tag

initializing_url
string

URL to visit before the start of a test

hostname
string

Hostname of requests to process

pathname
string

Pathname of requests to process

find
string

Text to search for

replace
string

Text to replace

Responses

Request samples

Content type
application/json
{
  • "name": "string",
  • "description": "string",
  • "initializing_url": "string",
  • "hostname": "string",
  • "pathname": "string",
  • "find": "string",
  • "replace": "string"
}

Response samples

Content type
application/json
{
  • "draft_tag": {
    }
}

Delete a draft tag

Delete the draft tag with the given draft tag ID

Authorizations:
API Key
path Parameters
draftTagId
required
string

ID of the draft tag to delete

Responses

Test

Create a test

Create a test in a given suite

Authorizations:
API Key
path Parameters
suiteId
required
string

ID of the suite to create the test in

Request Body schema: application/json
name
required
string

Name of the test

description
string

Description for the test

enabled
boolean
Default: true

Whether the test is enabled

persona_id
number

ID of the default persona for the test

test_type
string (TestType)
Default: "simulation"
Enum: "simulation" "coverage" "email" "mobile_app"

Type of the test. Available values:

  • simulation - Simulation
  • coverage - Coverage
  • email - Email
  • mobile_app - Mobile App
object (Variables)

Variables that are able to be referenced throughout test configs

Array of objects (StepCreate)

Steps within the test

Array of objects (TagValidation)

Common tag validations within the test

Responses

Request samples

Content type
application/json
{
  • "name": "My Test",
  • "description": "My first DataTrue test",
  • "persona_id": 1,
  • "test_type": 0,
  • "variables": {
    }
}

Response samples

Content type
application/json
{
  • "test": {
    }
}

Retrieve a test

Retrieve the test with the given test ID

Authorizations:
API Key
path Parameters
testId
required
string

ID of the test to retrieve

Responses

Response samples

Content type
application/json
{
  • "id": 1,
  • "suite_id": 1,
  • "name": "My Test",
  • "description": "My first DataTrue test",
  • "persona_id": 1,
  • "test_type": 0,
  • "variables": {
    },
  • "steps": [ ],
  • "tag_validations": [ ],
  • "created_at": 1530228858,
  • "updated_at": 1530228858
}

Update a test

Update the test with the given test ID

Authorizations:
API Key
path Parameters
testId
required
string

ID of the test to update

Request Body schema: application/json
name
required
string

Name of the test

description
string

Description for the test

enabled
boolean
Default: true

Whether the test is enabled

persona_id
number

ID of the default persona for the test

test_type
string (TestType)
Default: "simulation"
Enum: "simulation" "coverage" "email" "mobile_app"

Type of the test. Available values:

  • simulation - Simulation
  • coverage - Coverage
  • email - Email
  • mobile_app - Mobile App
object (Variables)

Variables that are able to be referenced throughout test configs

Responses

Request samples

Content type
application/json
{
  • "name": "string",
  • "description": "string",
  • "enabled": true,
  • "persona_id": 0,
  • "test_type": "simulation",
  • "variables": {
    }
}

Response samples

Content type
application/json
{
  • "test": {
    }
}

Delete a test

Delete the test with the given test ID

Authorizations:
API Key
path Parameters
testId
required
string

ID of the test to delete

Responses

Step

Create a step

Create a step in the given test

Authorizations:
API Key
path Parameters
testId
required
string

ID of the test to create the step in

Request Body schema: application/json
name
required
string

Name of the step

description
string

Description for the step

action
required
string
Enum: "goto_url" "click_link" "click_button" "text_field" "clear_text_field" "select_list" "click_element" "hover" "coverage" "enter" "close" "email" "go_back" "scroll_to" "run_script" "start_application" "send_keys" "click_mobile_element" "restart_app" "tap_coords" "hide_keyboard" "swipe" "mobile_select_list" "press_back"

Action for the step to perform. Valid values:

  • goto_url - Goto URL
  • click_link - Click Link
  • click_button - Click Button
  • text_field - Text Field
  • clear_text_field - Clear Text Field
  • select_list - Select List (Web)
  • click_element - Click Element
  • hover - Hover
  • coverage - Coverage
  • enter - Hit Enter
  • close - Close Browser Window
  • email - Email
  • go_back - Go Back
  • scroll_to - Scroll To
  • run_script - Run Script
  • start_application - Start Application
  • send_keys - Enter Text (Mobile)
  • click_mobile_element - Tap - Element (Mobile)
  • restart_app - Restart App
  • tap_coords - Tap - Coordinates
  • hide_keyboard - Hide Keyboard
  • swipe - Swipe
  • mobile_select_list - Select List (Mobile)
  • press_back - Press Back
target
string

Target for the step action

js_code
string

JavaScript to execute as part of a Run Script step

selector_type
string
Enum: "text" "id" "css" "xpath" "accessibility_id" "active_element"

Type of selector to use to identify the element to interact with

selector
string

Selector to use to identify the element to interact with

iframe_selector_type
string
Enum: "text" "id" "css" "xpath"

Type of selector to use to identify the iframe

iframe_selector
string

Selector to use to identify the iframe for the step

pause
number

How long to wait after the chosen action has been performed

wait_while_present
string

Block execution of the test while the selected element is present

use_common_tag_validations
boolean

Whether common tag validations should be validated for this step

object

Miscellaneous settings for steps

Array of objects (TagValidation)

Tag validations within the step

Array of objects (DataLayerValidation)

Data layer validations within the step

Responses

Request samples

Content type
application/json
{
  • "name": "My first step",
  • "action": 0,
  • "target": "demo.datatrue.com"
}

Response samples

Content type
application/json
{
  • "step": {
    }
}

Retrieve a step

Retrieve the step with the given step ID

Authorizations:
API Key
path Parameters
stepId
required
string

ID of the step to retrieve

Responses

Response samples

Content type
application/json
{
  • "id": 1,
  • "test_id": 1,
  • "name": "My first step",
  • "action": 0,
  • "target": "demo.datatrue.com",
  • "tag_validations": [ ],
  • "data_layer_validations": [ ],
  • "created_at": 1530228858,
  • "updated_at": 1530228858
}

Update a step

Update the step with the given step ID

Authorizations:
API Key
path Parameters
stepId
required
string

ID of the step to update

Request Body schema: application/json
name
required
string

Name of the step

description
string

Description for the step

action
required
string
Enum: "goto_url" "click_link" "click_button" "text_field" "clear_text_field" "select_list" "click_element" "hover" "coverage" "enter" "close" "email" "go_back" "scroll_to" "run_script" "start_application" "send_keys" "click_mobile_element" "restart_app" "tap_coords" "hide_keyboard" "swipe" "mobile_select_list" "press_back"

Action for the step to perform. Valid values:

  • goto_url - Goto URL
  • click_link - Click Link
  • click_button - Click Button
  • text_field - Text Field
  • clear_text_field - Clear Text Field
  • select_list - Select List (Web)
  • click_element - Click Element
  • hover - Hover
  • coverage - Coverage
  • enter - Hit Enter
  • close - Close Browser Window
  • email - Email
  • go_back - Go Back
  • scroll_to - Scroll To
  • run_script - Run Script
  • start_application - Start Application
  • send_keys - Enter Text (Mobile)
  • click_mobile_element - Tap - Element (Mobile)
  • restart_app - Restart App
  • tap_coords - Tap - Coordinates
  • hide_keyboard - Hide Keyboard
  • swipe - Swipe
  • mobile_select_list - Select List (Mobile)
  • press_back - Press Back
target
string

Target for the step action

js_code
string

JavaScript to execute as part of a Run Script step

selector_type
string
Enum: "text" "id" "css" "xpath" "accessibility_id" "active_element"

Type of selector to use to identify the element to interact with

selector
string

Selector to use to identify the element to interact with

iframe_selector_type
string
Enum: "text" "id" "css" "xpath"

Type of selector to use to identify the iframe

iframe_selector
string

Selector to use to identify the iframe for the step

pause
number

How long to wait after the chosen action has been performed

wait_while_present
string

Block execution of the test while the selected element is present

use_common_tag_validations
boolean

Whether common tag validations should be validated for this step

object

Miscellaneous settings for steps

Responses

Request samples

Content type
application/json
{
  • "name": "string",
  • "description": "string",
  • "action": "goto_url",
  • "target": "string",
  • "js_code": "string",
  • "selector_type": "text",
  • "selector": "string",
  • "iframe_selector_type": "text",
  • "iframe_selector": "string",
  • "pause": 0,
  • "wait_while_present": "string",
  • "use_common_tag_validations": true,
  • "settings": {
    }
}

Response samples

Content type
application/json
{
  • "step": {
    }
}

Delete a step

Delete the step with the given step ID

Authorizations:
API Key
path Parameters
stepId
required
string

ID of the step to delete

Responses

Tag Validation

Create a tag validation inside a test

Create a tag validation in a given test

Authorizations:
API Key
path Parameters
testId
required
string

ID of the test to create the tag validation in

Request Body schema: application/json
name
required
string

Name of the tag validation

description
string

Description for the tag validation

enabled
boolean
Default: true

Whether the tag validation is enabled

do_validation
boolean
Default: true

Whether the tag should be validated

detect_duplicates
boolean

Whether duplicate tags should be detected

validate_absence
boolean
Default: false

Whether the absence of the tag should be validated

object

Tag definition to use for the tag validation

hostname_detection
string

Regular expression to use to detect the hostname of the tag

pathname_detection
string

Regular expression to use to detect the path of the tag

query_detection
string

Regular expression to use to detect the query of the tag

hostname_validation
string

Regex to use to validate the hostname

pathname_validation
string

Regex to use to validate the path

account_id
string

Regex to use to detect the account ID for the tag

object

Interception settings for the tag validation

Array of objects

Query validations to perform as part of the tag validation

Responses

Request samples

Content type
application/json
{
  • "name": "Google Analytics",
  • "enabled": true,
  • "validate_absence": false,
  • "tag_definition": {
    },
  • "query_validations": [
    ]
}

Response samples

Content type
application/json
{
  • "tag_validation": {
    }
}

Create a tag validation inside a step

Create a tag validation inside a given step

Authorizations:
API Key
path Parameters
stepId
required
string

ID of the step to create the tag validation in

Request Body schema: application/json
name
required
string

Name of the tag validation

description
string

Description for the tag validation

enabled
boolean
Default: true

Whether the tag validation is enabled

do_validation
boolean
Default: true

Whether the tag should be validated

detect_duplicates
boolean

Whether duplicate tags should be detected

validate_absence
boolean
Default: false

Whether the absence of the tag should be validated

object

Tag definition to use for the tag validation

hostname_detection
string

Regular expression to use to detect the hostname of the tag

pathname_detection
string

Regular expression to use to detect the path of the tag

query_detection
string

Regular expression to use to detect the query of the tag

hostname_validation
string

Regex to use to validate the hostname

pathname_validation
string

Regex to use to validate the path

account_id
string

Regex to use to detect the account ID for the tag

object

Interception settings for the tag validation

Array of objects

Query validations to perform as part of the tag validation

Responses

Request samples

Content type
application/json
{
  • "name": "Google Analytics",
  • "enabled": true,
  • "validate_absence": false,
  • "tag_definition": {
    },
  • "query_validations": [
    ]
}

Response samples

Content type
application/json
{
  • "tag_validation": {
    }
}

Retrieve a tag validation

Retrieve the tag validation with the given tag validation ID

Authorizations:
API Key
path Parameters
tagValidationId
required
string

ID of the tag validation to retrieve

Responses

Response samples

Content type
application/json
{
  • "id": 1,
  • "step_id": 1,
  • "name": "Google Analytics",
  • "enabled": true,
  • "validate_absence": false,
  • "tag_definition": {
    },
  • "query_validations": [
    ],
  • "created_at": 1530228858,
  • "updated_at": 1530228858
}

Update a tag validation

Update the tag validation with the given tag validation ID

Authorizations:
API Key
path Parameters
tagValidationId
required
string

ID of the tag validation to update

Request Body schema: application/json
name
required
string

Name of the tag validation

description
string

Description for the tag validation

enabled
boolean
Default: true

Whether the tag validation is enabled

do_validation
boolean
Default: true

Whether the tag should be validated

detect_duplicates
boolean

Whether duplicate tags should be detected

validate_absence
boolean
Default: false

Whether the absence of the tag should be validated

object

Tag definition to use for the tag validation

hostname_detection
string

Regular expression to use to detect the hostname of the tag

pathname_detection
string

Regular expression to use to detect the path of the tag

query_detection
string

Regular expression to use to detect the query of the tag

hostname_validation
string

Regex to use to validate the hostname

pathname_validation
string

Regex to use to validate the path

account_id
string

Regex to use to detect the account ID for the tag

object

Interception settings for the tag validation

Array of objects

Query validations to perform as part of the tag validation

Responses

Request samples

Content type
application/json
{
  • "name": "Google Analytics",
  • "enabled": true,
  • "validate_absence": false,
  • "tag_definition": {
    },
  • "query_validations": [
    ]
}

Response samples

Content type
application/json
{
  • "tag_validation": {
    }
}

Delete a tag validation

Delete the tag validation with the given tag validation ID

Authorizations:
API Key
path Parameters
tagValidationId
required
string

ID of the tag validation to delete

Responses

Data Layer Validation

Create a data layer validation

Create a data layer validation in a given step

Authorizations:
API Key
path Parameters
stepId
required
string

ID of the step to create the data layer validation in

Request Body schema: application/json
name
required
string

Name of the data layer validation

description
string

Description for the data layer validation

enabled
boolean

Whether the data layer validation is enabled

source
string
Default: "dom"
Enum: "dom" "url" "cookie" "js_variable" "custom_js"

Source to use for the data layer validation

selector_type
string
Enum: "text" "id" "css" "xpath"

Type of selector to use to identify the element to validate

selector
string

Selector to use to identify the element to validate

iframe_selector_type
string
Enum: "xpath" "css"

Type of selector to use to identify the iframe

iframe_selector
string

Selector to use to identify the iframe

attr
string

Name of the attribute whose value to extract

cookie_name
string

Name of the cookie to extract the value from

js_variable_name
string

Name of the variable to use as the source

custom_js_code
string

JavaScript code to execute

regex
string

Regex to use to extract the value to save

variable_name
string

Name of the variable to save the return value to

validation_enabled
boolean

Whether the data layer should be validated

validate_absence
boolean

Whether the data layer validation should be negated

Array of objects

Property validations to perform as part of the data layer validation

Responses

Request samples

Content type
application/json
{
  • "name": "Title Exists",
  • "enabled": true,
  • "source": "js_variable",
  • "js_variable_name": "document.title",
  • "property_validations": [
    ]
}

Response samples

Content type
application/json
{
  • "data_layer_validation": {
    }
}

Retrieve a data layer validation

Retrieve the data layer validation with the given data layer validation ID

Authorizations:
API Key
path Parameters
dataLayerValidationId
required
string

ID of the data layer validation to retrieve

Responses

Response samples

Content type
application/json
{
  • "id": 1,
  • "step_id": 1,
  • "name": "Title Exists",
  • "enabled": true,
  • "source": "js_variable",
  • "js_variable_name": "document.title",
  • "property_validations": [
    ],
  • "created_at": 1530228858,
  • "updated_at": 1530228858
}

Update a data layer validation

Update the data layer validation with the given data layer validation ID

Authorizations:
API Key
path Parameters
dataLayerValidationId
required
string

ID of the data layer validation to update

Request Body schema: application/json
name
required
string

Name of the data layer validation

description
string

Description for the data layer validation

enabled
boolean

Whether the data layer validation is enabled

source
string
Default: "dom"
Enum: "dom" "url" "cookie" "js_variable" "custom_js"

Source to use for the data layer validation

selector_type
string
Enum: "text" "id" "css" "xpath"

Type of selector to use to identify the element to validate

selector
string

Selector to use to identify the element to validate

iframe_selector_type
string
Enum: "xpath" "css"

Type of selector to use to identify the iframe

iframe_selector
string

Selector to use to identify the iframe

attr
string

Name of the attribute whose value to extract

cookie_name
string

Name of the cookie to extract the value from

js_variable_name
string

Name of the variable to use as the source

custom_js_code
string

JavaScript code to execute

regex
string

Regex to use to extract the value to save

variable_name
string

Name of the variable to save the return value to

validation_enabled
boolean

Whether the data layer should be validated

validate_absence
boolean

Whether the data layer validation should be negated

Array of objects

Property validations to perform as part of the data layer validation

Responses

Request samples

Content type
application/json
{
  • "name": "Title Exists",
  • "enabled": true,
  • "source": "js_variable",
  • "js_variable_name": "document.title",
  • "property_validations": [
    ]
}

Response samples

Content type
application/json
{
  • "data_layer_validation": {
    }
}

Delete a data layer validation

Delete the data layer validation with the given data layer validation ID

Authorizations:
API Key
path Parameters
dataLayerValidationId
required
string

ID of the data layer validation to delete

Responses