Skip to navigation

Getting Started

View as Markdown

Import the collection into Postman. Obtain your Customer Portal login credentials from your Matrix Sciences integration contact.

Authenticate

Send POST https://one.mtxsci.com/api/1.1/wf/authenticate-v2 with these JSON fields:

{
"email": "user@example.com",
"password": "your-password"
}

Set Content-Type: application/json. On status: "success", use the returned response.token. The token lasts response.expires seconds (86400, or 24 hours). Supply it as the collection’s private local token value in Postman. All subsequent requests send:

Authorization: Bearer <token>

Select the customer and catalogs

Call GET https://one.mtxsci.com/api/1.1/wf/customers-v2?page=1. Select the returned customer_id for the intended division or plant and store its mapping to your own organizational identifiers.

Use that customer on subsequent requests, for example:

GET https://one.mtxsci.com/api/1.1/wf/tests-v2?page=1&customer_id=<customer_id>
Authorization: Bearer <token>

Maintain the mapping from your test identifiers to Matrix test code values. Use product-ids-v2 for Matrix product IDs and the customer item codes under specification.items[].item_number; use sites-v2 for site IDs. The product response includes specification names, descriptions, and mapped item names for specification management.

Prepare and send a submission

Send POST https://one.mtxsci.com/api/1.1/wf/submission-v2 with the Bearer header and Content-Type: application/json.

  1. Supply customer_id and the required submission fields documented in the endpoint reference. Use the laboratory and Matrix catalog values applicable to that customer.
  2. Assign a client_sample_ref to each sample and composite and store it with the corresponding external sample record. References must be unique across both arrays within a submission. They may repeat in a different submission.
  3. Put Matrix test codes in each row’s tests array. A composite’s client_sample_refs lists its member samples’ references; its own client_sample_ref identifies the composite.
  4. Keep result names in your own system. They are not required in the request. For a Matrix test code/analyte pair that maps to several result names, retain the result name originally requested with each sample.

The saved request contains type placeholders. Replace them with valid catalog values, dates, and distinct client references before sending.

Record the response and retrieve results

The saved acceptance response is:

{
"sample_submission_id": "string",
"status": "Success"
}

Check status: "Success" and store sample_submission_id alongside your internal request identifier. Samples can take up to five minutes to appear; wait at least five minutes, then query:

GET https://one.mtxsci.com/api/1.1/wf/samples-v2?page=1&customer_id=<customer_id>&sample_submission_id=<sample_submission_id>
Authorization: Bearer <token>

Use results-v2 with the same customer and submission filters for samples[].tests[].results[]. Match sample records by client_sample_ref within the submission. Continue through pages while hasNextPage is true.

Receive a results webhook

Configure delivery and the shared-secret header in the Customer Portal integrations module.

  1. Validate the secret in the header configured during setup before processing the payload. The secret is tied to a division or plant; use your stored mapping to establish that customer context.
  2. Match webhook SampleSubmissionID to the sample_submission_id stored beside your internal request identifier.
  3. Match sample records using client_sample_ref within that submission.
  4. Map Matrix test codes to your tests, then map Matrix test code plus analyte to your result names. Where a pair has more than one result-name mapping, use the originally requested name stored with the sample. For example, yeast or mold values for 11 g and 25 g portions require that original context.

The webhook shared secret is separate from the API Bearer token. Preserve the webhook field casing: SampleSubmissionID identifies the submission; the API’s read and submission responses use sample_submission_id.