The DataTrue management API provides a REST based interface to interact with the following resources:
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.
Retrieve the user profile for the user associated with the provided API key
{- "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"
}
Retrieve a listing of all accounts you have access to
[- {
- "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"
}
]
Retrieve an account for a given account ID
accountId required | string ID of the account to retrieve the suites for |
{- "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"
}
Retrieve a listing of all suites in a given account
accountId required | string ID of the account to retrieve the suites for |
[- {
- "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": [
- "example.com"
], - "sensitive_data_setting": "disabled",
- "tests": [
- {
- "id": 1,
- "name": "My Test",
- "description": "My first test",
- "test_type": 1,
- "created_at": 1530228858,
- "updated_at": 1530228858
}
], - "created_at": 1530228858,
- "updated_at": 1530228858
}
]
Create a suite in a given account
accountId required | string ID of the account to create the suite in |
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:
|
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:
|
object (Variables) Variables that are able to be referenced throughout test configs |
{- "name": "Welcome to DataTrue",
- "description": "This is a suite of example tests",
- "suite_type": 0,
- "persona_id": 1,
- "restart_between_tests": false,
- "excluded_domains": [
- "example.com"
], - "sensitive_data_setting": "disabled"
}
{- "suite": {
- "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": [
- "example.com"
], - "sensitive_data_setting": "disabled",
- "tests": [
- {
- "id": 1,
- "name": "My Test",
- "description": "My first test",
- "test_type": 1,
- "created_at": 1530228858,
- "updated_at": 1530228858
}
], - "created_at": 1530228858,
- "updated_at": 1530228858
}
}
Retrieve the suite with the given suite ID
suiteId required | string ID of the suite to retrieve |
{- "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": [
- "example.com"
], - "sensitive_data_setting": "disabled",
- "tests": [
- {
- "id": 1,
- "name": "My Test",
- "description": "My first test",
- "test_type": 1,
- "created_at": 1530228858,
- "updated_at": 1530228858
}
], - "created_at": 1530228858,
- "updated_at": 1530228858
}
Update the suite with the given suite ID
suiteId required | string ID of the suite to update |
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:
|
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:
|
object (Variables) Variables that are able to be referenced throughout test configs |
{- "name": "Welcome to DataTrue",
- "description": "This is a suite of example tests",
- "suite_type": 0,
- "persona_id": 1,
- "restart_between_tests": false,
- "excluded_domains": [
- "example.com"
], - "sensitive_data_setting": "disabled"
}
{- "suite": {
- "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": [
- "example.com"
], - "sensitive_data_setting": "disabled",
- "tests": [
- {
- "id": 1,
- "name": "My Test",
- "description": "My first test",
- "test_type": 1,
- "created_at": 1530228858,
- "updated_at": 1530228858
}
], - "created_at": 1530228858,
- "updated_at": 1530228858
}
}
Retrieve a listing of all draft tags in a given suite
suiteId required | string ID of the suite to retrieve the draft tags for |
[- {
- "name": "string",
- "description": "string",
- "initializing_url": "string",
- "hostname": "string",
- "pathname": "string",
- "find": "string",
- "replace": "string",
- "id": 0,
- "suite_id": 0
}
]
Create a draft tag in a given suite
suiteId required | string ID of the suite to create the draft tag in |
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 |
{- "name": "string",
- "description": "string",
- "initializing_url": "string",
- "hostname": "string",
- "pathname": "string",
- "find": "string",
- "replace": "string"
}
{- "draft_tag": {
- "name": "string",
- "description": "string",
- "initializing_url": "string",
- "hostname": "string",
- "pathname": "string",
- "find": "string",
- "replace": "string",
- "id": 0,
- "suite_id": 0
}
}
Retrieve the draft tag with the given draft tag ID
draftTagId required | string ID of the draft tag to retrieve |
{- "name": "string",
- "description": "string",
- "initializing_url": "string",
- "hostname": "string",
- "pathname": "string",
- "find": "string",
- "replace": "string",
- "id": 0,
- "suite_id": 0
}
Update the draft tag with the given draft tag ID
draftTagId required | string ID of the draft tag to update |
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 |
{- "name": "string",
- "description": "string",
- "initializing_url": "string",
- "hostname": "string",
- "pathname": "string",
- "find": "string",
- "replace": "string"
}
{- "draft_tag": {
- "name": "string",
- "description": "string",
- "initializing_url": "string",
- "hostname": "string",
- "pathname": "string",
- "find": "string",
- "replace": "string",
- "id": 0,
- "suite_id": 0
}
}
Create a test in a given suite
suiteId required | string ID of the suite to create the test in |
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:
|
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 |
{- "name": "My Test",
- "description": "My first DataTrue test",
- "persona_id": 1,
- "test_type": 0,
- "variables": {
- "abc": {
- "type": "preset",
- "value": "def"
}
}
}
{- "test": {
- "id": 1,
- "suite_id": 1,
- "name": "My Test",
- "description": "My first DataTrue test",
- "persona_id": 1,
- "test_type": 0,
- "variables": {
- "abc": {
- "type": "preset",
- "value": "def"
}
}, - "steps": [ ],
- "tag_validations": [ ],
- "created_at": 1530228858,
- "updated_at": 1530228858
}
}
Retrieve the test with the given test ID
testId required | string ID of the test to retrieve |
{- "id": 1,
- "suite_id": 1,
- "name": "My Test",
- "description": "My first DataTrue test",
- "persona_id": 1,
- "test_type": 0,
- "variables": {
- "abc": {
- "type": "preset",
- "value": "def"
}
}, - "steps": [ ],
- "tag_validations": [ ],
- "created_at": 1530228858,
- "updated_at": 1530228858
}
Update the test with the given test ID
testId required | string ID of the test to update |
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:
|
object (Variables) Variables that are able to be referenced throughout test configs |
{- "name": "string",
- "description": "string",
- "enabled": true,
- "persona_id": 0,
- "test_type": "simulation",
- "variables": {
- "property1": {
- "type": "preset",
- "value": "string"
}, - "property2": {
- "type": "preset",
- "value": "string"
}
}
}
{- "test": {
- "id": 1,
- "suite_id": 1,
- "name": "My Test",
- "description": "My first DataTrue test",
- "persona_id": 1,
- "test_type": 0,
- "variables": {
- "abc": {
- "type": "preset",
- "value": "def"
}
}, - "steps": [ ],
- "tag_validations": [ ],
- "created_at": 1530228858,
- "updated_at": 1530228858
}
}
Create a step in the given test
testId required | string ID of the test to create the step in |
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:
|
target | string Target for the step action |
js_code | string JavaScript to execute as part of a |
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 |
{- "name": "My first step",
- "action": 0,
- "target": "demo.datatrue.com"
}
{- "step": {
- "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
}
}
Retrieve the step with the given step ID
stepId required | string ID of the step to retrieve |
{- "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 the step with the given step ID
stepId required | string ID of the step to update |
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:
|
target | string Target for the step action |
js_code | string JavaScript to execute as part of a |
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 |
{- "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": {
- "strategy": "breadth_first",
- "page_depth": 0,
- "page_limit": 0,
- "obey_robots": true,
- "include_filter_operator": "equals",
- "include_filter": "string",
- "exclude_filter_operator": "equals",
- "exclude_filter": "string",
- "template_detection": true,
- "include_url_hash": true
}
}
{- "step": {
- "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
}
}
Create a tag validation in a given test
testId required | string ID of the test to create the tag validation in |
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 |
{- "name": "Google Analytics",
- "enabled": true,
- "validate_absence": false,
- "tag_definition": {
- "key": "Google Analytics (Universal)"
}, - "query_validations": [
- {
- "key": "t",
- "value": "pageview"
}
]
}
{- "tag_validation": {
- "id": 1,
- "step_id": 1,
- "name": "Google Analytics",
- "enabled": true,
- "validate_absence": false,
- "tag_definition": {
- "key": "Google Analytics (Universal)"
}, - "query_validations": [
- {
- "key": "t",
- "value": "pageview"
}
], - "created_at": 1530228858,
- "updated_at": 1530228858
}
}
Create a tag validation inside a given step
stepId required | string ID of the step to create the tag validation in |
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 |
{- "name": "Google Analytics",
- "enabled": true,
- "validate_absence": false,
- "tag_definition": {
- "key": "Google Analytics (Universal)"
}, - "query_validations": [
- {
- "key": "t",
- "value": "pageview"
}
]
}
{- "tag_validation": {
- "id": 1,
- "step_id": 1,
- "name": "Google Analytics",
- "enabled": true,
- "validate_absence": false,
- "tag_definition": {
- "key": "Google Analytics (Universal)"
}, - "query_validations": [
- {
- "key": "t",
- "value": "pageview"
}
], - "created_at": 1530228858,
- "updated_at": 1530228858
}
}
Retrieve the tag validation with the given tag validation ID
tagValidationId required | string ID of the tag validation to retrieve |
{- "id": 1,
- "step_id": 1,
- "name": "Google Analytics",
- "enabled": true,
- "validate_absence": false,
- "tag_definition": {
- "key": "Google Analytics (Universal)"
}, - "query_validations": [
- {
- "key": "t",
- "value": "pageview"
}
], - "created_at": 1530228858,
- "updated_at": 1530228858
}
Update the tag validation with the given tag validation ID
tagValidationId required | string ID of the tag validation to update |
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 |
{- "name": "Google Analytics",
- "enabled": true,
- "validate_absence": false,
- "tag_definition": {
- "key": "Google Analytics (Universal)"
}, - "query_validations": [
- {
- "key": "t",
- "value": "pageview"
}
]
}
{- "tag_validation": {
- "id": 1,
- "step_id": 1,
- "name": "Google Analytics",
- "enabled": true,
- "validate_absence": false,
- "tag_definition": {
- "key": "Google Analytics (Universal)"
}, - "query_validations": [
- {
- "key": "t",
- "value": "pageview"
}
], - "created_at": 1530228858,
- "updated_at": 1530228858
}
}
Create a data layer validation in a given step
stepId required | string ID of the step to create the data layer validation in |
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 |
{- "name": "Title Exists",
- "enabled": true,
- "source": "js_variable",
- "js_variable_name": "document.title",
- "property_validations": [
- {
- "name": "_string",
- "value": ".+",
- "operator": "regexp_match"
}
]
}
{- "data_layer_validation": {
- "id": 1,
- "step_id": 1,
- "name": "Title Exists",
- "enabled": true,
- "source": "js_variable",
- "js_variable_name": "document.title",
- "property_validations": [
- {
- "name": "_string",
- "value": ".+",
- "operator": "regexp_match"
}
], - "created_at": 1530228858,
- "updated_at": 1530228858
}
}
Retrieve the data layer validation with the given data layer validation ID
dataLayerValidationId required | string ID of the data layer validation to retrieve |
{- "id": 1,
- "step_id": 1,
- "name": "Title Exists",
- "enabled": true,
- "source": "js_variable",
- "js_variable_name": "document.title",
- "property_validations": [
- {
- "name": "_string",
- "value": ".+",
- "operator": "regexp_match"
}
], - "created_at": 1530228858,
- "updated_at": 1530228858
}
Update the data layer validation with the given data layer validation ID
dataLayerValidationId required | string ID of the data layer validation to update |
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 |
{- "name": "Title Exists",
- "enabled": true,
- "source": "js_variable",
- "js_variable_name": "document.title",
- "property_validations": [
- {
- "name": "_string",
- "value": ".+",
- "operator": "regexp_match"
}
]
}
{- "data_layer_validation": {
- "id": 1,
- "step_id": 1,
- "name": "Title Exists",
- "enabled": true,
- "source": "js_variable",
- "js_variable_name": "document.title",
- "property_validations": [
- {
- "name": "_string",
- "value": ".+",
- "operator": "regexp_match"
}
], - "created_at": 1530228858,
- "updated_at": 1530228858
}
}