Using the API

Link to Using the API copied to clipboard

Introduction

Using the axe Monitor 6.2 Application Programming Interface (API) involves getting started by installing a RESTful web services browser extension and using it to connect with axe Monitor. After the connection is established, requests can be made from the extension to return response data from axe Monitor. These requests can pertain to projects, scripts, scope definitions, issues and rules.

As a Deque axe Monitor licensee, you can then use that data as you see fit (provided it is in accordance with the signed Subscription License Agreement between your organization and Deque executed upon your purchase of the axe Monitor product).

On this page:

Overview

The axe Monitor v.6.2 Web Service REST API lets you integrate any application with axe Monitor. Parameters are sent in JavaScript Object Notation (JSON) format, and results are also returned in JSON format. All APIs are handled in the context of a signed-in user's permissions. For example, if the signed-in user has been granted Member access to Projects A and B, and Administrator access to Project C, those permissions are used by the APIs to calculate the allowed actions. All requests are made to the Core server URL in a axe Monitor deployment.

Caution must be used to not make API requests at a rate that will impact the overall performance of the system. Certain requests can take a long time to execute, especially when they involve a large amount of data records in the system.

Notes

It is important to keep in mind the following notes:

  • The full URL must include the “/worldspace” entry as the first in the command sequence. For example, if the request is “/organizationprojects” and the DNS name to the server is “myworldspace.deque.com”, then the full URL would be: “http://myworldspace.deque.com/worldspace/organizationprojects”.
  • All requests and parameters are case sensitive.
  • A login request must be made before any other request.
  • The HTTP header “Content-Type” should be set to “application/json” for all requests.
  • All APIs will return an HTTP 200 result code if the server processed the request. The response JSON object must be parsed to determine if the API was successful.
  • If an REST API is called without the authentication call being performed first, an HTML error page will be returned instead of a JSON result object.
  • Some API calls can take more than 60 seconds to execute, depending on the parameters, the load on the server and other factors, so an appropriate timeout should be set.
  • All parameter names must be enclosed in quotes.
  • All strings parameter values must be enclosed in quotes.
  • All strings must be URL encoded.

Prerequisites

To use the REST API, you must first authenticate to the server. You will need the URL of the axe Monitor server (WORLDSPACE_URL) you are connecting to. You must also have a valid Email Address and Password to communicate with the axe Monitor server.

Further Reading: For additional, detailed information about the REST protocol, see Representational State Transfer - WikipediA.

Getting Started with an API Debugging Extension

For demonstration purposes, the screen shots in this section use the Mozilla Firefox browser with a REST client add-on extension. The examples show the use of RESTClient, version 3.0.4, which is compatible with Firefox v.57 or later. The extension is a debugger for RESTful web services that allows you to construct custom HTTP requests (via resources URI + HTTP request body method) to directly test requests (API calls) against an axe Monitor server.

Step 1: Install the RESTClient extension in the Firefox browser.

  1. Launch Firefox and browse to https://addons.mozilla.org/en-US/firefox/addon/restclient.

  2. Within the RESTClient Extension section, click the +Add to Firefox button. clicking the Add to Firefox button from the Extensions page

    An add-on management dialog box drops down from the Address field that lists the required permissions of the RESTClient.

  3. Click the Add button to confirm addition of the RESTClient extension and your understanding of its required permissions. clicking the Add button to confirm addition action

    The add-on management drop-down window refreshes to display a message to confirm the RESTClient extension was added successfully.

  4. Click the OK button to dismiss the installation success message. clicking the OK button

    The add-on management drop-down dialog box closes.

    Note

    After successful addition of the extension to the browser, a logo button for the extension appears at the top, right of the browser to the right of the Address field for the purpose of quickly launching the extension.

Step 2: Launch the RESTClient extension

  1. Click the RESTClient browser toolbar button at the top, right to launch (open) it. clicking the REST Client extension icon button in extensions browser toolbar

    The RESTClient extension appears in a new browser tab.

Step 3: Specify Authentication Information

  1. At the top, left select Basic Authentication from the Authentication drop-down menu. selecting Basic from Authentication menu

    The Basic Authentication dialog box form pops up in a small foreground window.

  2. On the Basic Authentication dialog box, enter your Username and Password in the corresponding text entry fields, then click the Okay button. entering Username, Password, then clicking Okay button

    An Authentication Basic tag appears in the Headers section with an unique identifier.

    Headers section example showing Basic Authentication tag with unique ID

    At this point, with the authentication information saved, you are then able to establish a connection with the axe Monitor server. For example, you could specify the GET request method, enter your axe Monitor environment instance URL, then click the SEND button and authenticate automatically with the saved Username/Password credentials.

    authenticate SEND example using axe Monitor URL

Step 4: Requesting Custom Headers

Adding a custom header can be done via Headers > Custom Header with the following name and value: (Name: Content-Type and Value: application/json).

  1. From the main RESTClient horizontal menu, select Headers > Custom Header. selecting Custom Header from the Headers menu

    The Request Headers dialog box form pops up in a foreground window.

  2. On the Request Headers dialog box, type Content-Type in the Name field, application/json in the Value field, then click the Okay button. specifying Name, Value, then clicking the Okay button

    The Request Headers dialog box window closes and a tag appears in the Headers section to show the content type header request you just added.

    Headers tag example showing addition

Step 5: Completing User Authentication with a Post Request and Validating the Response

Signing in to axe Monitor from the REST API client can be done via specification of the following: Method: POST, URL: <ComplyURL>/worldspace/account/ajax/login, and Body: {"email":"user@deque.com","password":"password"}. After sending the post with email and password to the sign-in URL, the client displays a message to indicate successful authentication.

  1. In the Request section, click the down arrow button to the right of the Method field, then select the POST option from the drop-down menu. selecting POST from Method menu

  2. Type (or paste from virtual clipboard) into the URL field the address of your desired axe Monitor server environment instance followed by ../worldspace/account/ajax/login (for example, https://comply-qa.dequelabs.com/worldspace/account/ajax/login).

  3. In the Body field of the Request section, type (or paste) the following:

    {“email”:user@deque.com <mailto:user@deque.com>,”password”:”password”}
  4. At the top, right click the SEND button. specifying Method, URL, Body, then clicking the Send button

  5. In the Response section, click the Response tab.

    A message appears to indicate successful authentication and the API version, for example:

    {“authenticated”:true,”version”:”1.1.8”}

    example success response message

    You are now set up to test other API calls against the server, as desired.

Getting Started with Postman

Before you begin

The following steps assume you have already downloaded the free Postman app from https://www.getpostman.com/apps for your platform, installed it, and opened it first.

Step 1: Specify Authentication Information

After you specify the desired URL and environment of your instance of axe Monitor, you can then configure Basic Auth and specify a Username and Password that will represent the signed-in user you will impersonate as you interact with data associated with their account.

  1. On the Authorization tab, select Basic Auth from the TYPE drop-down menu on the left sidebar.

  2. Populate the Username field with the user you want to authenticate as (if different from your own).

  3. Populate the Password field with the value associated with the Username you intend to sign in as.

  4. Under the TYPE menu, click the Preview Request button.

    A popup message will appear at the lower right corner to indicate success. This means the authorization header is automatically generated when the request was sent.

    ![specifying Content-type JSON as custom Headers](https://media.dequeuniversity.com/product-docs/comply/6.4/en/images/Comply API Postman Authorization.png)

Step 2: Request Custom Headers

  1. On the HEaders tab, type Content-Type in the KEY field.

    The type-ahead suggestion should reveal this as a selectable option as you type.

  2. Type application/json in the VALUE field.

    The type-ahead suggestion should reveal this as a selectable option as you type.

    ![specifying Content-type JSON as custom Headers](https://media.dequeuniversity.com/product-docs/comply/6.4/en/images/Comply API Postman Headers.png)

Step 3: Complete User Authentication with a Post Request to Validate

  1. At the top, left actions menu, select POST.

  2. Type <URL>/worldspace/account/ajax/login in the URL field.

  3. On the Body tab, populate the KEY field with the user you want to authenticate as (if different from your own).

  4. On the next line, specify a Password key with the value associated with the Username you intend to sign in as.

  5. Click the SEND button. ![selecting Basic Authentication and specifying Username and Password details, then posting to validate](https://media.dequeuniversity.com/product-docs/comply/6.4/en/images/Comply API Postman User Authentication.png)

    A code message is returned to indicate authentication and the version:

    {
        "authenticated": true,
        "version":  "1.1.8"
    }

Working with Organizations and Projects

The subheadings that follow cover additional actions that can be taken pertaining to both organizations and projects.

Retrieving organization names for a user

To get the organization names associated with a signed-in user, after signing in, without any parameters in body part, use a GET request method to the /organizations URL.

Method: GET

URL: /worldspace/organizations

Example: https://comply-qa.dequelabs.com/worldspace/organizations

Retrieving organization project names for a user

To get the organization project names associated with a signed-in user, after signing in, without any parameters in body part, use a GET request method to the /organizationprojects URL.

Method: GET

URL: /worldspace/organizationprojects

Example: https://comply-qa.dequelabs.com/worldspace/organizationprojects

Retrieving an organization project summary report for a user

To get the organization project summary report associated with a signed-in user, after signing in, without any parameters in body part, use a GET request method to the /project/summaryReport/## URL.

Method: GET

URL: /project/summaryReport/$id

Examplehttps://comply-qa.dequelabs.com/worldspace/project/summaryReport/13

Downloading organization rules for a user

To download the rules associated with an organization of which the signed-in user is a member, after signing in, without any parameters in body part, use a GET request method to the /rules/org/$organizationid URL.

Method: GET

URL/rules/org/$organizationid

Examplehttps://comply-qa.dequelabs.com/worldspace/rules/org/34

Downloading public project rules for a user

To download the rules associated with a public project for the signed-in user, after signing in, without any parameters in body part, use a GET request method to the /rules URL.

Method: GET

URL/rules

Examplehttps://comply-qa.dequelabs.com/worldspace/rules

Downloading organization project issues for a user

To download the issues associated with an organization project for the signed-in user, after signing in, without any parameters in body part, use a GET request method to the /issues/projectid:label URL.

Method: GET

URL/issues/projectid:label

Examplehttps://comply-qa.dequelabs.com/worldspace/94:temp1

Retrieving a list of organizations and organization projects for a user by custom attribute

To get a listing of the orgs. and org.projects by custom attribute for a signed-in user, after signing in, without any parameters in body part, use a GET request method to the /projects/byCustomAttribute?customAttribute=&value= URL.

Method: GET

URL/projects/byCustomAttribute?customAttribute=&value=

Example: ../worldspace/projects/byCustomAttribute?customAttribute=levela&value=usa

Deleting organization project pages for a user

To delete the organization project pages for a signed-in user, after signing in, without any parameters in body part, use a DELETE request method to the /pages/##/ URL.

Method: DELETE

URL: /pages/$id

Example: https://comply-qa.dequelabs.com/worldspace/pages/94

Retrieving organization project analyzed pages for a user

To fetch the analyzed pages (content markup) for a signed-in user’s organization project, after signing in, without any parameters in body part, use a GET request method to the /pages URL.

Method: POST

URL: /pages

Example: https://comply-qa.dequelabs.com/worldspace/pages

Body:

{"id":"853","fetchUrl":"off","analyze":"on","compliance":"on","store":"off","page":"http://mars.dequ ecloud.com/Services.htm","content":"markup"}

Retrieve a project or page group's dashboard data

URL: /project/summaryReport/$id

where $id is project id

Method: GET

Content-Type: application/json

Parameters:

  • practice: practice name in it's short form (Example "A" for accessibility)
  • potentialIssues: on/off (on: will include potential issue counts in the report, off: will not include potential issue counts)
  • begin: start date in MM-dd-yyyy format (inclusive of this date’s data)
  • end: end date in MM-dd-yyyy format (inclusive of this date’s data)
  • pages: page group id (-1 if we need to get report for project)

Results:

  • success: true if operation succeeded, otherwise false
  • message: if operation failed, a detailed error message
  • report: results as follows
    • name: project name
    • id: project ID
    • score: the last scan in the period specified
    • issuesPerPage
    • totalPages
    • critical: number of pages with one or more critical issues
    • serious: number of pages with one or more serious issues
    • fair: number of pages with one or more moderate issues
    • good: number of pages with one or more minor or no issues
    • pageGroupSummaries: above summary data (name ,id, score etc) for each page group in the project. A json array of
      • name: name of the page group
      • id: page group id
      • score: score
      • scoreTrend: score trend data for page group
      • pageCount: pages count under this page group
      • p3: number of pages with one or more critical issues in this page group
      • p2: number of pages with one or more serious issues in this page group
      • p1: number of pages with one or more moderate issues in this page group
      • p0: number of pages with one or more minor issues in this page group
      • issuesPerPage: average number of issues per page
    • issuelist: list of issue groupings with data as follows
      • issuegrouping: issue group code
      • grouping: issue group short description (E.g. Alternative Text, Page structure etc)
      • standard: standard description
      • priority: priority of issues in this group
      • desc: description of issues in this group
      • level: WCAG level of this issue group if standard is WCAG, otherwise null
      • issues: issues count
      • pages: pages count
      • percent: %age of pages in which this group of issues reported
      • issueType: type of issue (Common/Manual/Automated)

Sample Result

{"success":true,"report":{"name":"qawb-7-jul-pgrps","id":81,"score":8,"issuesPerPage":17,"totalPages":54,"critical":49,"serious":1,"fair":0,"good":4,"pageGroupSummaries":[{"name":"laptop","id":75,"score":0,"scoreTrend":[["\"2016-07-07
05:59:29.0\"",0],["\"2016-07-07
10:53:28.0\"",0],["\"2016-07-08
03:29:49.0\"",0]],"pageCount":5,"p3":5,"p2":0,"p1":0,"p0":0,"issuesPerPage":33},{"name":"desktop","id":76,"score":0,"scoreTrend":[["\"2016-07-07
05:59:29.0\"",0],["\"2016-07-07
10:53:28.0\"",0],["\"2016-07-08 03:29:49.0\"",0]],"pageCount":5,"p3":5,"p2":0,"p1":0,"p0":0,"issuesPerPage":31},{"name":"cart","id":77,"score":0,"scoreTrend":[["\"2016-07-07
05:59:29.0\"",0],["\"2016-07-07
10:53:28.0\"",0],["\"2016-07-08
03:29:50.0\"",0]],"pageCount":3,"p3":3,"p2":0,"p1":0,"p0":0,"issuesPerPage":32},{"name":"support","id":78,"score":0,"scoreTrend":[["\"2016-07-07
05:59:29.0\"",0],["\"2016-07-07
10:53:28.0\"",0],["\"2016-07-08
03:29:50.0\"",0]],"pageCount":1,"p3":1,"p2":0,"p1":0,"p0":0,"issuesPerPage":18},{"name":"contact","id":79,"score":0,"scoreTrend":[["\"2016-07-07
05:59:29.0\"",0],["\"2016-07-07
10:53:28.0\"",0],["\"2016-07-08
03:29:50.0\"",0]],"pageCount":1,"p3":1,"p2":0,"p1":0,"p0":0,"issuesPerPage":15},{"name":"deals","id":80,"score":0,"scoreTrend":[["\"2016-07-07
05:59:29.0\"",0],["\"2016-07-07
10:53:28.0\"",0],["\"2016-07-08
03:29:50.0\"",0]],"pageCount":5,"p3":5,"p2":0,"p1":0,"p0":0,"issuesPerPage":43},{"name":"accounts","id":81,"score":0,"scoreTrend":[["\"2016-07-07
05:59:29.0\"",0],["\"2016-07-07
10:53:28.0\"",0],["\"2016-07-08
03:29:50.0\"",0]],"pageCount":4,"p3":4,"p2":0,"p1":0,"p0":0,"issuesPerPage":21}],"issuelist":[{"issuegrouping":"TEXT_ALTERNATIVES","grouping":"Alternative
text","standard":"Success Criterion 1.1.1 Non-text
Content","priority":"Serious","desc":"image
need alt text.","level":"Level
A","issues":1,"pages":1,"percent":"2%","issueType":"Manual"},{"issuegrouping":"TEXT_ALTERNATIVES","grouping":"Alternative
text","standard":"Success Criterion 1.1.1 Non-text
Content","priority":"Critical","desc":"Text
equivalent for button is missing or empty.","level":"Level
A","issues":2,"pages":1,"percent":"2%","issueType":"Automated"},{"issuegrouping":"COLOR","grouping":"Color","standard":"Success
Criterion 1.4.3 Contrast
(Minimum)","priority":"Serious","desc":"Poor
visibility between text and background
colors.","level":"Level
AA","issues":555,"pages":31,"percent":"57%","issueType":"Automated"},{"issuegrouping":"STRUCTURE","grouping":"Page
structure","standard":"Success Criterion 3.1.1 Language of
Page","priority":"Critical","desc":"The
primary language of this document has not been
set.","level":"Level
A","issues":22,"pages":22,"percent":"41%","issueType":"Automated"},{"issuegrouping":"TABLES","grouping":"Tables","standard":"Success
Criterion 1.3.1 Info and Relationships","priority":"Moderate","desc":"Use
header-id method to mark up column and row header cells on complex tables like
this using 'rowspan' or 'colspan'(on 'th') in 'tbody'
section.","level":"Level A","issues":15,"pages":13,"percent":"24%","issueType":"Automated"},{"issuegrouping":"TABLES","grouping":"Tables","standard":"Success
Criterion 1.3.1 Info and
Relationships","priority":"Minor","desc":"Table
does not have a caption element.","level":"Level
A","issues":48,"pages":35,"percent":"65%","issueType":"Automated"},{"issuegrouping":"TABLES","grouping":"Tables","standard":"Success
Criterion 1.3.1 Info and
Relationships","priority":"Moderate","desc":"Text
of first row that spans the width of table should be marked up as
caption.","level":"Level
A","issues":2,"pages":2,"percent":"4%","issueType":"Automated"},{"issuegrouping":"TABLES","grouping":"Tables","standard":"Success
Criterion 1.3.1 Info and Relationships","priority":"Minor","desc":"Summary
for layout tables should be empty or absent. This table has been detected as a
layout table because it has only one column of data that is not
empty.","level":"Level
A","issues":2,"pages":1,"percent":"2%","issueType":"Automated"},{"issuegrouping":"NAVIGATION","grouping":"Navigation","standard":"Success
Criterion 2.1.1 Keyboard","priority":"Minor","desc":"Use
client-side image maps instead of server-side
maps.","level":"Level
A","issues":1,"pages":1,"percent":"2%","issueType":"Automated"},{"issuegrouping":"FRAMES","grouping":"Frames","standard":"Success
Criterion 2.4.1 Bypass Blocks","priority":"Serious","desc":"Missing
title for this frame or iframe element.","level":"Level
A","issues":1,"pages":1,"percent":"2%","issueType":"Automated"},{"issuegrouping":"FORMS","grouping":"Forms","standard":"Success
Criterion 1.3.1 Info and Relationships","priority":"Critical","desc":"Checkbox
control does not have an explicit label or a title
attribute.","level":"Level
A","issues":2,"pages":2,"percent":"4%","issueType":"Automated"},{"issuegrouping":"FORMS","grouping":"Forms","standard":"Success
Criterion 1.3.1 Info and
Relationships","priority":"Critical","desc":"Password
field does not have an explicit label or a title
attribute.","level":"Level
A","issues":8,"pages":6,"percent":"11%","issueType":"Automated"},{"issuegrouping":"FORMS","grouping":"Forms","standard":"Success
Criterion 1.3.1 Info and
Relationships","priority":"Critical","desc":"Radio
button does not have an explicit label or a title
attribute.","level":"Level
A","issues":2,"pages":1,"percent":"2%","issueType":"Automated"},{"issuegrouping":"FORMS","grouping":"Forms","standard":"Success
Criterion 1.3.1 Info and
Relationships","priority":"Critical","desc":"Text
entry field does not have an explicit label or a title
attribute.","level":"Level
A","issues":40,"pages":33,"percent":"61%","issueType":"Automated"},{"issuegrouping":"FORMS","grouping":"Forms","standard":"Success
Criterion 1.3.1 Info and
Relationships","priority":"Critical","desc":"Select
(combo) control does not have an explicit label or a title
attribute.","level":"Level A","issues":5,"pages":3,"percent":"6%","issueType":"Automated"},{"issuegrouping":"SEMANTICS","grouping":"Semantics","standard":"Success
Criterion 2.4.2 Page
Titled","priority":"Minor","desc":"Document
does not contain a title element.","level":"Level
A","issues":4,"pages":4,"percent":"7%","issueType":"Automated"},{"issuegrouping":"TEXT_ALTERNATIVES","grouping":"Alternative
text","standard":"Success Criterion 1.1.1 Non-text
Content","priority":"Serious","desc":"Images
must have an alt attribute","level":"Level A","issues":111,"pages":26,"percent":"48%","issueType":"Automated"},{"issuegrouping":"STRUCTURE","grouping":"Page
structure","standard":"Success Criterion 1.3.1 Info and
Relationships","priority":"Critical","desc":"This
page does not have enough headings.","level":"Level
A","issues":22,"pages":22,"percent":"41%","issueType":"Automated"},{"issuegrouping":"PARSING","grouping":"Parsing","standard":"Success
Criterion 4.1.1
Parsing","priority":"Critical","desc":"The
id attribute's value should be unique.","level":"Level
A","issues":14,"pages":5,"percent":"9%","issueType":"Automated"},{"issuegrouping":"TEXT_ALTERNATIVES","grouping":"Alternative
text","standard":"Success Criterion 4.1.2 Name, Role,
Value","priority":"Critical","desc":"Buttons
or elements that act as buttons MUST have a visible name or text alternative
for image","level":"Level
A","issues":2,"pages":1,"percent":"2%","issueType":"Automated"},{"issuegrouping":"TEXT_ALTERNATIVES","grouping":"Alternative
text","standard":"Success Criterion 4.1.2 Name, Role, Value","priority":"Critical","desc":"HTML
links or elements that act as links MUST have a visible name or text
alternative for image as well as an HREF","level":"Level
A","issues":50,"pages":22,"percent":"41%","issueType":"Automated"}]}}

Retrieve a project list by a custom attribute name/value pair

URL: /projects/byCustomAttribute

Method: GET

Response Content-Type: application/json

Parameters:

  • customAttribute: Name of the custom attribute by which project list need to be pulled
  • value: value of the custom attribute to match while fetching projects list

Results:

  • status code: 200 if operation succeeded and 400 on bad input
  • success: true if operation succeeded, otherwise false
  • message: if operation failed, a detailed error message
  • projects: list of projects with below fields
    • id: project ID
    • name: project name

Working with Custom Rules

In the custom rule code sample that follows, alter the following four values as desired:

  • organizationId = retrieved from axe Monitor (this can be found in the URL of organization settings)
  • name = the name for your custom rule
  • description= description for the custom rule
  • customRuleSetJson = enable rules to be included in custom rule with a “true”

Organization Settings page URL identification number displayed at end of Address bar in browser

Location of the ID# at end of General Organization Settings page URL in axe Monitor

Custom Rule Example

{

"organizationId": 7, "name": "axe Monitor",

"description": "Dylan's custom rule", "customRuleSetJson": “true”

{

"rules": [

{

"id": "dylang", "enabled": false, "metadata": {

"description": "Ensures lang attributes have the value of dylan", "help": "lang attribute must have the value of dylan",

"helpUrl": "https://example.com/dylang"

},

"selector": "html",

"any": [],

"all": [], "none": [ "dylang"

],

"tags": [ "wcag2aa"

]

},

{

"id": "area­alt", "enabled": false

},

{

"id": "button­name", "enabled": false

},

{

"id": "data­table", "enabled": false

},

{

"id": "definition­list", "enabled": false

},

{

"id": "dlitem", "enabled": false

},

{

"id": "duplicate­id", "enabled": false

},

{

"id": "image­alt", "enabled": false

},

{

"id": "input­image­alt", "enabled": false

},

{

"id": "label", "enabled": false

},

{

"id": "link­name", "enabled": false

},

{

"id": "list", "enabled": false

},

{

"id": "listitem", "enabled": false

},

{

"id": "accesskeys", "enabled": false

},

{

"id": "aria­allowed­attr", "enabled": false

},

{

"id": "aria­required­attr", "enabled": false

},

{

"id": "aria­required­children", "enabled": false

},

{

"id": "aria­required­parent", "enabled": false

},

{

"id": "aria­roles", "enabled": false

},

{

"id": "aria­valid­attr­value", "enabled": false

},

{

"id": "aria­valid­attr", "enabled": false

},

{

"id": "audio­caption", "enabled": false

},

{

"id": "blink", "enabled": false

},

{

"id": "bypass", "enabled": false

},

{

"id": "checkboxgroup", "enabled": false

},

{

"id": "color­contrast", "enabled": true

},

{

"id": "document­title", "enabled": false

},

{

"id": "empty­heading", "enabled": false

},

{

"id": "frame­title", "enabled": false

},

{

"id": "heading­order", "enabled": false

},

{

"id": "html­has­lang", "enabled": false

},

{

"id": "html­lang­valid", "enabled": false

},

{

"id": "image­redundant­alt", "enabled": false

},

{

"id": "label­title­only", "enabled": false

},

{

"id": "layout­table", "enabled": false

},

{

"id": "link­in­text­block", "enabled": false

},

{

"id": "marquee", "enabled": false

},

{

"id": "meta­refresh", "enabled": false

},

{

"id": "meta­viewport­large", "enabled": false

},

{

"id": "meta­viewport", "enabled": false

},

{

"id": "object­alt", "enabled": false

},

{

"id": "radiogroup",

"enabled": false

},

{

"id": "region", "enabled": false

},

{

"id": "scope", "enabled": false

},

{

"id": "server­side­image­map", "enabled": false

},

{

"id": "skip­link", "enabled": false

},

{

"id": "tabindex", "enabled": false

},

{

"id": "valid­lang", "enabled": false

},

{

"id": "video­caption", "enabled": false

},

{

"id": "video­description", "enabled": false

},

{

"id": "applet", "enabled": false

}

],

"checks": [

{

"id": "dylang", "options": [

"dylan"

],

"evaluate": "function (node, options) {\n var lang = (node.getAttribute(\"lang\") ||

\"\").trim().toLowerCase();\n   var xmlLang = (node.getAttribute(\"xml:lang\") ||

\"\").trim().toLowerCase();\n           var invalid = [];\n                        (options || []).forEach(function(cc) {\n

cc = cc.toLowerCase();\n   if (lang && (lang === cc || lang.indexOf(cc.toLowerCase() + \"­\")

=== 0)) {\n  lang = null;\n }\n    if (xmlLang && (xmlLang === cc || xmlLang.indexOf(cc.toLowerCase() + \"­\") === 0)) {\n          xmlLang = null;\n }\n

});\n  if (xmlLang) {\n       invalid.push('xml:lang=\"' + xmlLang + '\"');\n     }\n       if (lang)

{\n    invalid.push('lang=\"' + lang + '\"');\n     }\n     if (invalid.length) {\n this.data(invalid);\n return false;\n           }\n               return false;\n           }",

"metadata": {

"impact": critical",

"messages": {

"pass": "The lang attribute is Dylan",

"fail": "The lang attribute can only be Dylan"

}

}

}

]

}

}

Adding a new custom rule to axe Monitor through REST API

URLhttps://comply-qa.dequelabs.com/worldspace/customrulesets

Method: POST

Instructions: Copy the given custom rule code (as shown in the above example) and paste into the REST API client Body field after updating the code as desired (for example, the required org.ID and custom rule name), then click the SEND button.

pasting the custom rule JSON file code into the Body field fo the RESTClient

Success response after sending the custom rule content to axe Monitor

 After adding the custom rule to axe Monitor from the REST API client, sign in to axe Monitor and navigate to the org.policies page, where you will see the rule is available for selection as an active standard:

selecting the added Custom Ruleset from the Active Standards table of the Testing Standards tab panel

Example of the selected custom rule in the Active Standards table in axe Monitor

Create a custom rule set for a given organization

URL: /customrulesets

Method: POST

Response Content-Type: application/json

Parameters:

  • organizationId: organization id
  • name: name of the custom rule set
  • description: description of the custom rule set
  • customRuleSetJson: rule set json

Results:

  • status code: 200 if operation succeeded and 400 on bad input
  • success: true if operation succeeded, otherwise false
  • message: if operation failed, a detailed error message

Dylang Example - https://dequeuniversity.com/assets/json/dylang.json

Update a custom rule set with a given id

URL: /customrulesets/$id

Method: PUT

Response Content-Type: application/json

Parameters:

  • $id: id of rule set to be updated
  • name: name of the custom rule set
  • description: description of the custom rule set
  • customRuleSetJson: rule set json

Results:

  • status code: 200 if operation succeeded and 400 on bad input
  • success: true if operation succeeded, otherwise false
  • message: if operation failed, a detailed error message

Delete a custom rule set with a given id

URL: /customrulesets/$id

Method: DELETE

Response Content-Type: application/json

Parameters:

  • $id: id of rule set to be deleted

Results:

showing the DELETE option in the Method field

Successful result message display after the delete method completes

  • status code: 200 if operation succeeded and 400 on bad input
  • success: true if operation succeeded, otherwise false
  • message: if operation failed, a detailed error message

Retrieve the details of a custom ruleset for a axe Monitor organization using REST API

URL: /customrulesets/$id

Method: GET

Response Content-Type: application/json

Parameters:

  • organizationId: organization id

Example Result:

https://comply-qa.dequelabs.com/worldspace/customrulesets/7

the URL suffix displaying the ID# and the custom rule code in the Response Body (Preview) tab of the Response section

Response Body section displaying retrieved custom ruleset code content from specified URL

Retrieve a list of custom and default rulesets for an organization as part of project details API

URL: /projects/$id

Method: GET

Response Content-Type: application/json

Parameters:

  • $id: project id

The Headers section displaying the Content-Type as: application/json, with the Response Body (Highlight) tab displaying the Project Details that were retrieved

Example of successful retrieval of project details displayed in the Response body tab

Results:

  • success: true if operation succeeded, otherwise false
  • message: if operation failed, a detailed error message
  • project: project details
  • projectconfig: project config details
  • domains: list of domains
  • templates: scope definitions
  • rulePrioritizations: rule prioritizations
  • issueSrcLength: configured issue source length allowed
  • standardOptions: standards
  • eventOptions: event options
  • qualityOptions: quality options
  • practices: practices for project
  • prjStandards: Project standards
  • useHash: Use hash to determine page uniqueness
  • hashJS: JavaScript to generate hash if provided
  • defaultRuleset: default rule set for the organization. If none it would set to the one given in axe Monitor's config file for property standardToUseByFireEyesII.
  • rulesets: list of rule sets
    • id: id of the rule set
    • name: name of the rule set
    • description: description of the rule set
    • ruleSetJson: rule set json

Retrieve a list of custom and default rulesets for an organization from the project resources API

URL: /projects/resources/$id

Method: GET

Response Content-Type: application/json

Parameters:

  • $id: project id

Result Example:

Showing the GET option in the Method field

Example of project resources retrieved for a project id displayed in the Response Body tab of the RESTClient

Result data can include:

  • success: true if operation succeeded, otherwise false
  • message: if operation failed, a detailed error message
  • labels: list of project labels
  • usernames: list of active user names
  • scripts: list of project scripts
  • project: project details
  • defaultRuleset: default rule set for the organization. If none it would set to the one given in axe Monitor's config file for property standardToUseByFireEyesII.
  • rulesets: list of rule sets
    • id: id of the rule set
    • name: name of the rule set
    • description: description of the rule set
    • ruleSetJson: rule set json

Retrieve a list of custom rule sets for a given organization

URL: /customrulesets

Method: GET

Response Content-Type: application/json

Parameters:

  • organizationId: organization id

Results:

  • status code: 200 if operation succeeded and 400 on bad input
  • success: true if operation succeeded, otherwise false
  • message: if operation failed, a detailed error message
  • customRuleSets: list of custom rule sets with below fields for each rule set
    • id: id of the rule set
    • name: name of the rule set
    • description: description of the rule set
    • ruleSetJson: rule set json

Retrieve the details of a custom rule set for a given id

URL: /customrulesets/$id

Method: GET

Response Content-Type: application/json

Parameters:

  • $id:  id of the rule set

Results:

  • status code: 200 if operation succeeded and 400 on bad input
  • success: true if operation succeeded, otherwise false
  • message: if operation failed, a detailed error message
  • customRuleSet: rule set details with below fields
    • id: id of the rule set
    • name: name of the rule set
    • description: description of the rule set
    • ruleSetJson: rule set json

Other Specific API Calls Available (with Endpoints)

Additionally, the following calls are also available as of the v.6.2 axe Monitor API, which include the corresponding endpoints for each that you can point your HTTP client at to interact with data resources. '%s' corresponds to the unique identifier that represents a system-assigned numeric value.

  • "status": "worldspace/status"
  • "project": "worldspace/projects/%s"
  • "resources": "worldspace/projects/resources/%s"
  • "script": "worldspace/scripts/%s"
  • "edit-scope": "worldspace/templates/%s"
  • "delete-scope": "worldspace/templates/%s"
  • "add-scope": "worldspace/templates"
  • "upload-script": "worldspace/issues"
  • "get-issues": "worldspace/issues/forAxe/%s"
  • "upload-issues": "worldspace/issues/fromAxe/save"
  • "rulesetDefinitions": "custom-rules/ruleSetDefinitions"
  • "axe-version": "custom-rules/axeVersions/%s"
  • "axe-versions": "custom-rules/axeVersions/"
  • "update": "worldspace/logEntry/download"
  • "rulesets": "worldspace/standardToUseByFireEyesII"

Note: This corresponds to the axe-core standard intended for use with both axe Monitor and the axe DevTools extension.