Skip to main content
GET
https://sandbox.getcollate.io/api
/
v1
/
dataQuality
/
testCases
/
{id}
/
testCaseResult
GET /v1/dataQuality/testCases/{id}/testCaseResult
from metadata.sdk import configure
from metadata.sdk.entities import TestCases

configure(
    host="https://your-company.getcollate.io/api",
    jwt_token="your-jwt-token"
)

# Get test case results
results = TestCases.get_test_case_results("c1bce355-fa2f-48c6-ab4d-fad722a56ed7")
for r in results.data:
    print(f"{r.timestamp}: {r.testCaseStatus} - {r.result}")

# Get results within a time range
results = TestCases.get_test_case_results(
    "c1bce355-fa2f-48c6-ab4d-fad722a56ed7",
    start_ts=1769900000000,
    end_ts=1769990000000
)

# Add a test result
TestCases.add_test_case_result(
    "c1bce355-fa2f-48c6-ab4d-fad722a56ed7",
    timestamp=1769982800000,
    testCaseStatus="Success",
    result="Max value 42 is between 1 and 100",
    testResultValue=[
        {"name": "maxValue", "value": "42"}
    ]
)
{
  "data": [
    {
      "timestamp": 1769982800000,
      "testCaseStatus": "Success",
      "result": "Max value 42 is between 1 and 100",
      "testResultValue": [
        {
          "name": "maxValue",
          "value": "42"
        }
      ]
    },
    {
      "timestamp": 1769896400000,
      "testCaseStatus": "Failed",
      "result": "Max value 150 is not between 1 and 100",
      "testResultValue": [
        {
          "name": "maxValue",
          "value": "150"
        }
      ]
    }
  ],
  "paging": {
    "total": 2
  }
}

Test Case Results

Retrieve test case execution results or add new results programmatically. Each result includes a status, timestamp, and detailed result values.

Get Test Case Results

id
string
required
UUID of the test case.
startTs
integer
Start timestamp (epoch milliseconds) to filter results.
endTs
integer
End timestamp (epoch milliseconds) to filter results.

Add a Test Case Result

Use PUT /v1/dataQuality/testCases/{id}/testCaseResult to add a new test result.
id
string
required
UUID of the test case.

Body Parameters

timestamp
integer
required
Epoch timestamp (milliseconds) of the test execution.
testCaseStatus
string
required
Status of the test execution: Success, Failed, or Aborted.
result
string
Human-readable summary of the test result.
testResultValue
array
Array of detailed result values produced by the test.
GET /v1/dataQuality/testCases/{id}/testCaseResult
from metadata.sdk import configure
from metadata.sdk.entities import TestCases

configure(
    host="https://your-company.getcollate.io/api",
    jwt_token="your-jwt-token"
)

# Get test case results
results = TestCases.get_test_case_results("c1bce355-fa2f-48c6-ab4d-fad722a56ed7")
for r in results.data:
    print(f"{r.timestamp}: {r.testCaseStatus} - {r.result}")

# Get results within a time range
results = TestCases.get_test_case_results(
    "c1bce355-fa2f-48c6-ab4d-fad722a56ed7",
    start_ts=1769900000000,
    end_ts=1769990000000
)

# Add a test result
TestCases.add_test_case_result(
    "c1bce355-fa2f-48c6-ab4d-fad722a56ed7",
    timestamp=1769982800000,
    testCaseStatus="Success",
    result="Max value 42 is between 1 and 100",
    testResultValue=[
        {"name": "maxValue", "value": "42"}
    ]
)
{
  "data": [
    {
      "timestamp": 1769982800000,
      "testCaseStatus": "Success",
      "result": "Max value 42 is between 1 and 100",
      "testResultValue": [
        {
          "name": "maxValue",
          "value": "42"
        }
      ]
    },
    {
      "timestamp": 1769896400000,
      "testCaseStatus": "Failed",
      "result": "Max value 150 is not between 1 and 100",
      "testResultValue": [
        {
          "name": "maxValue",
          "value": "150"
        }
      ]
    }
  ],
  "paging": {
    "total": 2
  }
}

Returns

Get results returns a paginated list of test case result objects, ordered by timestamp (newest first). Add result returns the test case result object that was created.

Response

data
array
Array of test case result objects.
paging
object
Pagination information.

Test Case Status Values

StatusDescription
SuccessThe test passed — all assertions were met
FailedThe test failed — one or more assertions were not met
AbortedThe test was aborted due to an error or timeout

Error Handling

CodeError TypeDescription
401UNAUTHORIZEDInvalid or missing authentication token
403FORBIDDENUser lacks permission to view or add test results
404NOT_FOUNDTest case with given ID does not exist