Interface applications with the AChecker through its experimental API. This is version 0.1, dated Mar 2009.
Two types AChecker web service API are provided:
Below is a table of the parameter you can use to send a request to AChecker for validating URI.
If you want to use AChecker public validation server, use the parameters below in conjunction with the following base URI:
http://websiteaccessibilitychecker.com/checkacc.php
(replace with the address of your own server if you want to call a private instance of the validator)
Parameter | Description | Default value |
---|---|---|
uri | The encoded URL of the document to validate. | None, must be given. |
id | The "Web Service ID" generated once successfully registering into AChecker. This ID is a 40 characters long string. It can always be retrieved from user's "Profile" page. | None, must be given. |
guide | The guidelines to validate against. Separate each guideline with comma (,). | WCAG2-AA. Or one or some of these values: BITV1: abbreviation of guideline bitv-1.0-(level-2); 508: abbreviation of guideline section-508; STANCA: abbreviation of guideline stanca-act; WCAG1-A: abbreviation of guideline wcag-1.0-(level-a); WCAG1-AA: abbreviation of guideline wcag-1.0-(level-aa); WCAG1-AAA: abbreviation of guideline wcag-1.0-(level-aaa); WCAG2-A: abbreviation of guideline wcag-2.0-l1; WCAG2-AA: abbreviation of guideline wcag-2.0-l2; WCAG2-AAA: abbreviation of guideline wcag-2.0-l3. |
output | Triggers the various outputs formats of the validator. If unset, the usual HTML format will be sent. If set to rest, the REST interface will be triggered. | html. Or either one of these values: html or rest |
offset | The line offset to begin validation on the html output from URI. | 0 |
http://websiteaccessibilitychecker.com/checkacc.php?uri=http%3A%2F%2Fatutor.ca& id=888ca9e3f856baa0120755ecd8ffae6be3142029&output=html&guide=STANCA,WCAG2-AA&offset=10
Goal: Validate URI http://atutor.ca
against guidelines "Stanca Act" and "Wcag 2.0 L2".
Ignore the first 10 lines of html content from http://atutor.ca. Returns validation report
in html format.
A REST success response for the validation of a document (invalid) will look like this:
<?xml version="1.0" encoding="UTF-8"?> <resultset> <summary> <status>FAIL</status> <sessionID>40-character-long string</sessionID> <NumOfErrors>number</NumOfErrors> <NumOfLikelyProblems>number</NumOfLikelyProblems> <NumOfPotentialProblems>number</NumOfPotentialProblems> <guidelines> <guideline>string</guideline> ... </guidelines> </summary> <results> <result> <resultType>string</resultType> <lineNum>number</lineNum> <columnNum>number</columnNum> <errorMsg>encoded string</errorMsg> <errorSourceCode>encoded string</errorSourceCode> <repair>encoded string</repair> <decisionPass>encoded string</decisionPass> <decisionFail>encoded string</decisionFail> <decisionMade>string</decisionMade> <decisionMadeDate>string</decisionMadeDate> </result> ... </results> </resultset>
<?xml version="1.0" encoding="UTF-8"?> <errors> <totalCount>number</totalCount> <error code="401"> <message>Empty URI.</message> </error> <error code="402"> <message>Empty web service ID.</message> </error> </errors>
Element | Description |
---|---|
resultset | The root element of REST response. Encloses validation summary and results information. |
summary | The summary element of the validation response. Encloses validation summary information, the numbers of different types of problems and the title of guidelines validating against. |
status | Can be one of these values: FAIL, CONDITIONAL PASS, PASS. FAIL is set when there is/are known problem(s). CONDITIONAL PASS is set when there is no known problems but there is/are likely or potential problem(s). PASS is set when there is no problems found, OR, there is no known problems and likely/potential problems have pass decisions made on. |
sessionID | The same ID must be sent back in make/reverse decisions request in response to the validation request. This is to ensure the make/reverse decision request comes from the authenticated source. |
NumOfErrors | Counts the number of known problems. |
NumOfLikelyProblems | Counts the number of likely problems. |
NumOfPotentialProblems | Counts the number of potential problems. |
guidelines | The main guideline element. Encloses all the titles of the guidelines that have been validated against. |
guideline | A child of guidelines . Encloses the title of the guideline that has been validated against. |
results | Encapsulates all data about problems encountered through the validation process. |
result | A child of results . Encloses details of one check problem. |
resultType | A child of result . Can be one of these values: Error, Likely Problem, Potential Problem. |
lineNum | A child of result . Within the source code of the validated document, refers to the line where the error was detected. |
columnNum | A child of result . Within the source code of the validated document, refers to the column of the line where the error was detected. |
errorMsg | A child of result . The actual error message. |
errorSourceCode | A child of result . The line of the source where the error/problem was detected. |
repair | A child of result . The actual message of how to repair. Only presented when resultType is "Error". |
sequenceID | A child of result . The unique sequence ID identifying each error/problem. This ID is used to pinpoint each error/problem in make/reverse decision request. |
decisionPass | A child of result . The actual text message of the pass decision. Only presented when resultType is "Likely Problem" or "Potential Problem". |
decisionFail | A child of result . The actual text message of the fail decision. Only presented when resultType is "Likely Problem" or "Potential Problem". |
decisionMade | A child of result . Only presented when the decision has been made by user. Can be one of these two values: PASS, FAIL. PASS is set when
pass decision is chosen by the user. Otherwise, FAIL is set. |
decisionMadeDate | A child of result . Only presented when the decision has been made by user. The date and time when the decision was made. |
errors | Encapsulates all data about errors encountered through the validation process. |
totalCount | a child of errors . Counts the number of errors listed. |
error | a child of errors . Encloses the actual error code and error message. |
message | a child of error . The actual error message. |
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE style PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <style type="text/css"> ul {font-family: Arial; margin-bottom: 0px; margin-top: 0px; margin-right: 0px;} li.msg_err, li.msg_info { font-family: Arial; margin-bottom: 20px;list-style: none;} span.msg{font-family: Arial; line-height: 150%;} code.input { margin-bottom: 2ex; background-color: #F8F8F8; line-height: 130%;} span.err_type{ padding: .1em .5em; font-size: smaller;} </style> <input value="4eefdfed3b98badf1f138ec83712358d67ffac9e" type="hidden" name="sessionid" /> <p> <strong>Result: </strong> <span style="background-color: red; border: solid green; padding-right: 1em; padding-left: 1em">FAIL</span> <span style="color:red"><span style="font-weight: bold;">44 Errors 103 Likely Problems 217 Potential Problems </span></span> <strong><br /> <strong>Guides: </strong> <a title="BITV 1.0 (Level 2)(link opens in a new window)" target="_new" href="http://localhost/achecker/guideline/view_guideline.php?id=1">BITV 1.0 (Level 2)</a> <a title="Section 508(link opens in a new window)" target="_new" href="http://localhost/achecker/guideline/view_guideline.php?id=2">Section 508</a> <a title="Stanca Act(link opens in a new window)" target="_new" href="http://localhost/achecker/guideline/view_guideline.php?id=3">Stanca Act</a> <a title="WCAG 1.0 (Level A)(link opens in a new window)" target="_new" href="http://localhost/achecker/guideline/view_guideline.php?id=4">WCAG 1.0 (Level A)</a> <a title="WCAG 1.0 (Level AA)(link opens in a new window)" target="_new" href="http://localhost/achecker/guideline/view_guideline.php?id=5">WCAG 1.0 (Level AA)</a> <a title="WCAG 1.0 (Level AAA)(link opens in a new window)" target="_new" href="http://localhost/achecker/guideline/view_guideline.php?id=6">WCAG 1.0 (Level AAA)</a> <a title="WCAG 2.0 L1(link opens in a new window)" target="_new" href="http://localhost/achecker/guideline/view_guideline.php?id=7">WCAG 2.0 L1</a> <a title="WCAG 2.0 L2(link opens in a new window)" target="_new" href="http://localhost/achecker/guideline/view_guideline.php?id=8">WCAG 2.0 L2</a> <a title="WCAG 2.0 L3(link opens in a new window)" target="_new" href="http://localhost/achecker/guideline/view_guideline.php?id=9">WCAG 2.0 L3</a> </p> <h3>Accessibility Review</h3> <h4>Errors</h4> <div id="errors" style="margin-top:1em"> <ul> ... // error details </ul> </div> <div id="likely_problems" style="margin-top:1em"> <ul> ... // likely problem details </ul> </div> <div id="potential_problems" style="margin-top:1em"> <ul> ... // potential problem details </ul> </div>Sample result detail of the check that decision has been made
<li class="msg_info"> <span class="err_type"><img src="http://localhost/achecker/images/info.png" alt="Info" title="Info" width="15" height="15" /></span> <em>Line 247, Column 9</em>: <span class="msg"> <a href="http://localhost/achecker/checker/suggestion.php?id=197" onclick="popup('http://localhost/achecker/checker/suggestion.php?id=197'); return false;" title="Suggest improvements on this error message" target="_new">Anchor text may not identify the link destination.</a> </span> <pre><code class="input"><a href="/contact.php"></code></pre> <p class="helpwanted"> </p> <table> <tr> <td> <input value="P" type="radio" name="d[5_2_54]" id="pass5_2_54" /> <label for="pass5_2_54">Anchor has text that identifies the link destination.</label> </td> </tr> <tr> <td> <input value="F" type="radio" name="d[5_2_54]" id="fail5_2_54" /> <label for="fail5_2_54">Anchor does not have text that identifies the link destination.</label> </td> </tr> <tr> <td> <input value="N" type="radio" name="d[5_2_54]" id="nodecision5_2_54" checked="checked" /> <label for="nodecision5_2_54">No Decision</label> </td> </tr> </table> </li>Sample result detail of the check that decision has NOT been made
<li class="msg_info">
<span class="err_type"><img src="http://localhost/achecker/images/info.png" alt="Info" title="Info" width="15" height="15" /></span>
<em>Line 246, Column 9</em>:
<span class="msg">
<a href="http://localhost/achecker/checker/suggestion.php?id=197"
onclick="popup('http://localhost/achecker/checker/suggestion.php?id=197'); return false;"
title="Suggest improvements on this error message" target="_new">Anchor text may not identify the link destination.</a>
</span>
<pre><code class="input"><a href="/archive.php"></code></pre>
<p class="helpwanted">
</p>
<table class="form-data">
<tr>
<th align="left">Decision:</th>
<td>Anchor has text that identifies the link destination.</td>
</tr>
<tr>
<th align="left">Date:</th>
<td>2009-03-04 14:33:06</td>
</tr>
<tr>
<td colspan="2">
<input value="Reverse Decision" type="submit" name="reverse[5_2_54]" />
</td>
</tr>
</table>
</li>
<div id="error"> <h4>The following errors occurred:</h4> <ul> <li>Empty URI. <small><small>(AC_ERROR_EMPTY_URI)</small></small></li> </ul> <ul> <li>Empty web service ID. <small><small>(AC_ERROR_EMPTY_WEB_SERVICE_ID)</small></small></li> </ul> <ul> <li>No sequence ID is given. <small><small>(AC_ERROR_SEQUENCEID_NOT_GIVEN)</small></small></li> </ul> </div>
Error Code | Description |
---|---|
401 | Empty URI. |
402 | Invalid UR. |
403 | Empty web service ID. |
404 | Invalid web service ID. |
Below is a table of the parameter you can use to send a request to AChecker for making decisions on likely or potential problems.
As said, if you want to use AChecker public validation server, use the parameters below in conjunction with the following base URI:
http://websiteaccessibilitychecker.com/checkacc.php
(replace with the address of your own server if you want to call a private instance of the validator)
Parameter | Description | Default value |
---|---|---|
uri | The encoded URL of the document to validate. | None, must be given. |
id | The "Web Service ID" generated once successfully registering into AChecker. This ID is a 40 characters long string. It can always be retrieved from user's "Profile" page. | None, must be given. |
session | The "sessionid" embedded in the validation response. In REST format, it's the value of element <sessionID>. In HTML format, it's the value of hidden variable "sessionid" | None, must be given. |
output | Triggers the various outputs formats of the validator. If unset, the usual HTML format will be sent. If set to rest, the REST interface will be triggered. | html. Or either one of these values: html or rest |
[sequenceID] | The sequence ID in the validation response that identifies each likely or potential problems. In REST format, it's the value of element <sequenceID>. In HTML format, it's the key value of radio button array d[5_2_54], d[6_5_5] ... 5_2_54, 6_5_5 is the [sequenceID]. (This value is red-highlighted in above html sample response.) | None. This parameter can appear as many times as user desires. The value of [sequenceID] can be one of
these: P : pass F : fail N : no decision |
reverse | When this parameter is presented and set to "true", the decisions on sequenceIDs sent in the request are all set to "No Decision" (N) no matter what values are given for the sequenceIDs in the request. | None. When present, must be value "true" |
http://localhost/achecker/decisions.php?uri=http%3A%2F%2Fatutor.ca&id=888ca9e3f856baa0120755ecd8ffae6be3142029 &session=c124694572284112cb54679565ec13dd57ed6ccf&output=html&1=P&2=F&3=N&4=P
Goal: Set decision on problem sequence ID 1 to pass decision, 2 to fail decision, 3 to no decision, 4 to pass decision. Return response in HTML format.
http://localhost/achecker/decisions.php?uri=http%3A%2F%2Fatutor.ca&id=888ca9e3f856baa0120755ecd8ffae6be3142029 &session=c124694572284112cb54679565ec13dd57ed6ccf&output=rest&1=P&2=F&3=N&4=P&reverse=true
Goal: Reverse decisions on problem sequence ID 1, 2, 3, 4. All decisions for these sequence IDs are set to "decision has not been made". Return response in REST format.
A REST success response for the make/reverse decision request will look like this:
<?xml version="1.0" encoding="UTF-8"?> <summary> <status>success</status> </summary>
<?xml version="1.0" encoding="UTF-8"?> <errors> <totalCount>number</totalCount> <error code="401"> <message>Empty URI.</message> </error> <error code="402"> <message>Empty web service ID.</message> </error> </errors>
Element | Description |
---|---|
summary | The summary element of the validation response. Encloses the validation summary result. |
status | a child of summary . Only has one value: success. |
errors | Encapsulates all data about errors encountered through the validation process. |
totalCount | a child of errors . Counts the number of errors listed. |
error | a child of errors . Encloses the actual error code and error message. |
message | a child of error . The actual error message. |
<?xml version="1.0" encoding="UTF-8"?> <div id="success">Success</div>
Error Code | Description |
---|---|
401 | Empty URI. |
402 | Invalid UR. |
403 | Empty web service ID. |
404 | Invalid web service ID. |
405 | No sequence id is given. |