Partial success responses

Test Center supports partial success responses for restore or delete operations and batch operations such as associating or dissociating test suites with requirements, or creating functional test cases.

The HTTP response code for batch operations is 207. The response is an object that consists of two arrays, successes and failures. The content of the successes array differs depending on the operation. For most operations it is a list of unique identifiers of items for which the operation was successful. The failures array contains a list of HTTP Problem Details objects organized by a type of problem. It indicates errors together with unique identifiers of items for which the operation failed. The included objects are the same type of object as those for individual failure responses, described in Errors.

For delete and restore operations the HTTP response code is 207 or 200. The outcome depends on your set of query parameters. The 207 response works exactly the same as for the batch operations. The 200 response, on the other hand, is returned only if the operation was fully successful. The restored or deleted object is returned in the successes array. Instead of the failures array with a reason for the operation's failure, you get a 4XX status.

This sample error response shows mixed results when trying to associate a test suite with a requirement. It tells you that the test suite with the testSuiteId of 77 was successfully associated with the requirement. The operation was unsuccessful for the test suite with the testSuiteId of 122 because the test suite no longer exists.

{
   "successes":[
      77
   ],
   "failures":[
      {
         "type":"resource.not.found",
         "title":"Resource not found",
         "requestField":"testSuiteId",
         "requestValues":[
            122
         ]
      }
   ]
}