How to access tests not at the root level via REST API

edited August 2019 in Peer Support


While it partially works, I'm having trouble working out how to access some individual tests via the REST API.

I can see the list of tests when I hit taoTest/RestTests with only the Accept header. And I can retrieve an individual test whose parent is the root Test class by providing the uri header with the test's URI. But any that are further down in the hierarchy of classes (directories) that I try to retrieve in the same way simply return a 412 Precondition Failed status with the following payload:

"success": false,
"errorCode": 0,
"errorMsg": "One of the precondition for this type of request was not satisfied",
"version": "3.3.0-RC02"

I stepped through with xdebug and can see that it fails in class.CrudService.php's get() method where it checks $this->isInScope($uri), which seems to indicate that you cannot retrieve items that aren't at the root. Even the exception's message is "The URI must be a valid resource under the root Class".

So I have a couple of questions regarding using REST:

  • Is it possible to retrieve items (tests, in this case) further down in the hierarchy?
  • Is it possible to retrieve and/or manipulate the classes themselves?
  • And is it possible to search for items by the values of their attributes?

I have tried a bunch of different things, read as many docs as I can find on the subject, but am unable to figure it out.

Currently using version 3.3.0-RC02.

Many thanks,


Sign In or Register to comment.

We use cookies on our website to support technical features that enhance your user experience. Cookie Policy Privacy Policy