Skip to navigation

Results

View as Markdown

List test results

Retrieve samples with nested laboratory tests and analyte results. Preserve the sample, test, and analyte context for each result.

Request: GET https://one.mtxsci.com/api/1.1/wf/results-v2

Authentication: Authorization: Bearer <token>, using response.token from authenticate-v2.

Success: 200 OK with a JSON body recorded as text/plain;charset=utf-8.

Request body: None.

Query parameters

ParameterFormatRequirement and usage
pageInteger in query stringPage to retrieve; start at 1.
customer_idStringRequired. Authorized customer from customers-v2.
sample_idStringOptional downstream sample identifier filter.
sample_submission_idStringOptional submission filter: use sample_submission_id returned by submission-v2.
start_dateYYYY-MM-DDDate-range start filter.
end_dateYYYY-MM-DDDate-range end filter.

Response envelope

FieldTypeDescription
pageStringReturned page number, for example "1".
hasNextPageBooleanWhether another page is available.
samplesArray of objectsRecords in this page.

Keep the customer and filters unchanged while paging. Increment page while hasNextPage is true; stop when it is false.

Sample fields

Each object in samples contains the sample fields documented on samples-v2, including sample_submission_id and client_sample_ref, plus tests (an array of objects).

Test fields

These fields appear in each object in samples[].tests.

FieldObserved typeDescription
testDescriptionStringHuman-readable test name.
codeStringTest catalog code, corresponding to code in tests-v2.
aduedateStringAnalysis due date and time as display text.
intelgroupStringTest grouping label returned by the service.
avaluserStringAnalysis validation user reference.
avaldateStringAnalysis validation date and time as display text.
analysisLateFlagStringAnalysis late indicator encoded as text.
resultTypeStringResult classification.
nonreportingStringNonreporting indicator encoded as text, not a JSON boolean.
rushBooleanRush indicator returned by the service. This response field does not make rush a supported submission-v2 input.
quantityIntegerQuantity returned with the test.
tatAnalysisStringAnalysis turnaround value as text.
testStatusStringTest status.
resultsArray of objectsAnalyte results for this test.

Result fields

These fields appear in each object in samples[].tests[].results.

FieldObserved typeDescription
analyteStringAnalyte name or description.
analyteGroupStringAnalyte grouping label.
resultStringReported value; may contain numeric or qualitative text.
resultNumericStringNumeric result representation encoded as text. Do not substitute it for the reported value.
unitStringReported unit or basis of measurement.
mdlStringDetection-limit field returned by the service; may be empty.
violationValueStringViolation value returned by the service; may be empty.
violationTypeStringViolation type encoded as text.
violationFlagBooleanViolation indicator returned by the service.
resultSortOrderStringResult sort-order value encoded as text.

Correlation and result mapping

Traverse samples[].tests[].results[]. Match the submission using sample_submission_id and the individual sample or composite using client_sample_ref. Use each test’s code and each result’s analyte to map the value to your system’s result name. Preserve the originally requested result name when one Matrix test/analyte pair maps to several customer result names. Result names are maintained by your system and are not required in submission requests.

result, resultNumeric, and nonreporting are strings; rush and violationFlag are booleans; quantity is an integer in the example. Preserve reported values, units, and field casing. Read timestamps have no offset; do not assume UTC.

Results webhook

Configure delivery in the Customer Portal integrations module. Validate the shared secret in the header agreed during setup before processing a payload. The secret is tied to a division or plant and is separate from the API Bearer token.

Use webhook SampleSubmissionID to find the internal request linked to the submission’s returned sample_submission_id. Correlate samples by client_sample_ref within that submission. Maintain Matrix test code-to-customer test mappings and Matrix test code plus analyte-to-result-name mappings in your system. For a one-to-many mapping, retain which result name was originally requested, such as the applicable 11 g or 25 g yeast or mold result.

The webhook submission field is SampleSubmissionID; the read API field is sample_submission_id. Apply the webhook’s configured payload field names when receiving events. The saved example below is the results-v2 read response.

Saved example

The attached 200 OK example preserves the documented field names, nesting, and types using generic placeholders. Use the actual hasNextPage flag to determine whether another page is available.

Authentication

AuthorizationBearer

Use response.token from authenticate-v2. response.expires is the lifetime in seconds (86400 = 24 hours).

Query parameters

pageintegerOptional>=1Defaults to 1

Returned page number, for example "1".

customer_idstringRequired

Required authorized customer_id from customers-v2.

sample_idstringOptional
Optional downstream sample identifier filter.
sample_submission_idstringOptional

Optional submission filter: use sample_submission_id returned by submission-v2.

start_datedateOptional

Date-range start filter.

end_datedateOptional

Date-range end filter.

Response

OK