1. Home
  2. For Testers
  3. Lab Testing & Results

How do I Utilize the Third-Party Integration Webhook to Export Test Results?

Programmatically export test results from Confident to your desired third-party software tools utilizing the Client API and Webhook!

Our Webhook takes events that occur within the Confident system and converts them into outbound requests to an endpoint (or multiple endpoints) to consume data related to the event that occurred.

In this Article:

Webhook URL

The Webhook url that you will need to abide by has the following requirements:

  • The endpoint which Confident POSTs to MUST be HTTPS
  • The endpoint will need to handle JSON data

Events

Sample Published

The sample.publish event corresponds to when a Confident Sample is Published. This can happen multiple times for a Sample. It will occur when an Order is completed, but can also occur afterwards if the Sample is revised and re-published by the lab. You will receive multiple events in this case, where the Sample Payload will have a date (UPDATE KEY NAME) that can be used as a high water mark.

POST Data

Note: See the Payloads section below for more information on our Sample Payload.

Responding

Respond with a status code of 200 for success. All other status codes will result in the request being considered a failure and will trigger our retry protocol.

Retries & Failures

Retry Limits

Failed requests for any specific event will be retried up to 3 times and will not retry the same event after. Please contact us if attaining a continually failed event is needed.

Consecutive Failure Limit

If your Webhook fails consecutively 10 times, your Webhook will be disabled. Please contact us at api@confidentlims.com to re-enable your Webhook.

Adding a Webhook within Confident

Adding a new Webhook is simple and straightforward:

  1. Log in at https://accounts.confidentlims.com/login
  2. Navigate to Settings -> Organization -> Integrations

  3. Click “Add Webhook URL” at the bottom and enter your desired destination URL for the Webhook

Testing / Maintaining your Webhook(s)

Confident offers some tooling within the Webhook Integrations settings to be able to test and maintain your Webhook(s).

Testing / sending individual Samples to your Webhook

Within your Webhook integrations settings you should be greeted with the below after adding a Webhook:

  • Below your defined Webhook URL, you are able to enter a Published Sample ID and hit “Send”.
  • Doing so will send a user generated Webhook call to the URL saved above.
  • You can freely use this capability to also send older samples to yourself manually.

Investigating Failures and Re-Sending

Clicking the “Show Logs” should open information about prior attempts to send to your Webhook, shown in the screenshot below.

From here, you are able to evaluate what has succeeded / failed with specific Webhook calls, along with the ability to “Re-Send” specific ones from the past (regardless of if they were successful or unsuccessful).

Payloads

Sample Payload

id: (string) Sample ID

order_id: (string) Orders ID

client_id: (int) Client ID

order_status_id: (int) Order Status ID

order_status_name: (string) Order Status Name

sample_name: (string) Name of Sample

strain_name: (string) Name of Sample Strain

sample_type_id: (int) Sample Type ID

sample_type_name: (string) Sample Type Name

sample_category_id: (int) Sample Category ID

sample_category_name: (string) Sample Category Name

production_method_name: (string) Production Method name

production_method_id: (int) Production Method ID

test_packages: [

{

id: (int) Unique ID for Test Package

name: (string) Test Package Name

}

]

last_modified: (timestamp) Time this sample was last modified

initial_weight: (float) Sample weight at order verification

initial_weight_unit: (string) Unit type for weight measurements (units or g)

test_types: [

{

id: (int) Unique ID for Test Type

name: (string) Test Type Name

abbreviation: (string) Test Type Abbreviation

}

]

cover_image: {

filename: (string)

public_key: (uuid) Unique public key for file

url: (string) Public URL to access file

}

images: [ Will also contain cover image

{

filename: (string)

public_key: (uuid) Unique public key for file

url: (string) Public URL to access file

}

]

notes: (string) Notes about the sample

batch_id: (string) Unique ID from the client's inventory management system of the client's batch from which the sample tested by the lab came

batch_size: (float) Size of the client's batch from which the sample tested by the lab came

batch_size_unit: (string) Unit type for batch size (units, lb, or g)

lab_data: (object) Test Result Data, see LabDataPayload for more info

lot_id: (string) Unique ID from the client's inventory management system of the client's lot from which the sample tested by the lab came

lot_size: (float) Size of the client's lot from which the sample tested by the lab came

lot_size_unit: (string) Unit type for lot size (units, lb, or g)

production_run_id: (string) Unique ID from the client's inventory management system of the client's production run from which the sample tested by the lab came

production_run_size: (float) Size of the client's production run from which the sample tested by the lab came

production_run_size_unit: (string) Unit type for production run size (units, lb, or g)

regulator_sample_id: (string) Unique ID from the state's seed-to-sale tracking system of the sample tested by the lab

manifest_id: (string) Unique ID from the state's seed-to-sale tracking system of the sample manifest from which the sample tested by the lab came

regulator_batch_id: (string) Unique ID from the state's seed-to-sale tracking system of the client's batch from which the sample tested by the lab came

regulator_lot_id: (string) Unique ID from the state's seed-to-sale tracking system of the client's lot from which the sample tested by the lab came

regulator_sample_id2: (string) (for Leaf) Pre-Transfer Batch ID

regulator_batch_id2: (string) (for Leaf) Pre-Transfer Inventory/Lot ID

harvest_id: (string) Unique ID from the state's seed-to-sale tracking system of the client's harvest lot from which the sample tested by the lab came

production_date: (timestamp) Harvest/Production Date [when sample was produced]

date_samples_collected: (timestamp) Collection Date [when sample was collected]

public_url: (string) Unique URL for viewing this sample or CoA without requiring a login. Should be added to CoAs and used for QR codes or other barcode images so end consumers can verify the integrity of the data

units_per_serving: (float) Serving Size

servings_per_container: (float) Number of Servings in one Container

unit_description: (string) Information describing what a "unit" means for this sample (i.e 1 Bottle)

container_description: (string) Information describing what a "unit" means for this sample (i.e 1 Gummy)

regulatory_category_id: (int) Unique ID for sample's regulatory category

solvents_used: (string) Information about the solvents used in testing

 

LabData Payload

date_created: (timestamp) Date Lab Data was created

status: (status) Pass = 1, Fail = 2, Incomplete = 3 // FIX THESE

categories: {

<category_name>: { // see Categories below for more info on each category

info_fields: {

<info_field>: xxx,

<info_field>: yyy,

}

},

compounds: [

{

name: compound_key for what is being tested,

value: test result value - string representing numeric value (eg: "1.02")

lod: limit of detection - in the same units as value

loq: limit of quantitation - in the same units as value

limit: value limit over which this test 'fails' - in the same units as value

max: upper limit of quantitation - in same units as value

stdev: calculated standard deviation of sample replicate results for the particular analyte - a number between 0-1

regulatornotes: notes to be posted to state traceability systems (e.g. METRC, BioTrack or Leaf) when applicable

rsd: calculated Relative Standard Deviation of the analyte values

rpd: calculated Relative Percent Difference of the analyte values

limitrangelow: lower limit when restricting value to a range

limitrangehigh: upper limit when restricting value to a range

}, ...above structure repeated for each compound

]

}

Categories

Category Status IDs
  • Passed = 1
  • Failed = 2
  • Completed (could not pass or fail) = 3

Cannabinoids

container_description: Description of container (eg. bottle, box, tin)

date_tested: date the sample was tested for this assay

digits: [default: 2] number of digits to display on certificate of analysis

dry_weight: weight of aliquot after drying

footnote: any relevant footnote information associated with the assay - see above for details

input_units: [default: %] units test data is being submitted in select from allowed units

method: testing method - eg, GC-FID, HPLC, etc

ml_weight: the weight in grams of 1ml of sample when any unit fields are 'mg/ml'

notes: optional testing notes for this assay

notes_2: optional testing notes for this assay

notes_3: optional testing notes for this assay

notes_4: optional testing notes for this assay

reported_as_wet: optional flag for if numbers are reported including moisture weight (wet) or converted (dry)

report_units: [default: %] the primary units displayed on the certificate of analysis

secondary_report_units: the secondary units displayed on the certificate of analysis

servings_per_container: Number of servings per container

signatory_name: name of lab employee to appear on certificate of analysis

signatory_title: title of lab employee to appear on certificate of analysis

signature: url to signature image for report

status: pass or fail integer id from status enum - see above

unit_description: definition of one unit when any unit fields are 'mg/unit'

unit_weight: the weight in grams of the whole unit submitted for sampling when any unit fields are 'mg/unit'

units_per_serving: Number of units per serving

wet_weight: weight of aliquot as received

 

Foreign Matter

date_tested: date the sample was tested for this assay

digits: [default: 2] number of digits to display on certificate of analysis

footnote: any relevant footnote information associated with the assay - see above for details

input_units: [default: %] units test data is being submitted in select from allowed units

notes: optional testing notes for this assay

notes_2: optional testing notes for this assay

notes_3: optional testing notes for this assay

notes_4: optional testing notes for this assay

report_units: [default: %] the primary units displayed on the certificate of analysis

secondary_report_units: the secondary units displayed on the certificate of analysis

signatory_name: name of lab employee to appear on certificate of analysis

signatory_title: title of lab employee to appear on certificate of analysis

signature: url to signature image for report

status: pass or fail integer id from status enum - see above

 

Homogeneity

date_tested: date the sample was tested for this assay

digits: [default: 0] number of digits to display on certificate of analysis

footnote: any relevant footnote information associated with the assay - see above for details

input_units: [default: %] units test data is being submitted in select from allowed units

notes: optional testing notes for this assay

notes_2: optional testing notes for this assay

notes_3: optional testing notes for this assay

notes_4: optional testing notes for this assay

report_units: [default: %] the primary units displayed on the certificate of analysis

reported_as_wet: optional flag for if numbers are reported including moisture weight (wet) or converted (dry)

secondary_report_units: the secondary units displayed on the certificate of analysis

signatory_name: name of lab employee to appear on certificate of analysis

signatory_title: title of lab employee to appear on certificate of analysis

signature: url to signature image for report

status: pass or fail integer id from status enum - see above

 

Microbials

date_tested: date the sample was tested for this assay

digits: [default: 0] number of digits to display on certificate of analysis

footnote: any relevant footnote information associated with the assay - see above for details

input_units: [default: cfu/g] units test data is being submitted in select from allowed units

notes: optional testing notes for this assay

notes_2: optional testing notes for this assay

notes_3: optional testing notes for this assay

notes_4: optional testing notes for this assay

report_units: [default: cfu/g] the primary units displayed on the certificate of analysis

reported_as_wet: optional flag for if numbers are reported including moisture weight (wet) or converted (dry)

secondary_report_units: the secondary units displayed on the certificate of analysis

signatory_name: name of lab employee to appear on certificate of analysis

signatory_title: title of lab employee to appear on certificate of analysis

signature: url to signature image for report

status: pass or fail integer id from status enum - see above

wet_weight: weight of aliquot as received

 

Metals

date_tested: date the sample was tested for this assay

digits: [default: 0] number of digits to display on certificate of analysis

footnote: any relevant footnote information associated with the assay - see above for details

input_units: [default: ppb] units test data is being submitted in select from allowed units

notes: optional testing notes for this assay

notes_2: optional testing notes for this assay

notes_3: optional testing notes for this assay

notes_4: optional testing notes for this assay

report_units: [default: ppb] the primary units displayed on the certificate of analysis

reported_as_wet: optional flag for if numbers are reported including moisture weight (wet) or converted (dry)

secondary_report_units: the secondary units displayed on the certificate of analysis

signatory_name: name of lab employee to appear on certificate of analysis

signatory_title: title of lab employee to appear on certificate of analysis

signature: url to signature image for report

status: pass or fail integer id from status enum - see above

 

Moisture

date_tested: date the sample was tested for this assay

digits: [default: 1] number of digits to display on certificate of analysis

dry_weight: weight of aliquot after drying

footnote: any relevant footnote information associated with the assay - see above for details

input_units: [default: %] units test data is being submitted in select from allowed units

notes: optional testing notes for this assay

notes_2: optional testing notes for this assay

notes_3: optional testing notes for this assay

notes_4: optional testing notes for this assay

report_units: [default: %] the primary units displayed on the certificate of analysis

reported_as_wet: optional flag for if numbers are reported including moisture weight (wet) or converted (dry)

secondary_report_units: the secondary units displayed on the certificate of analysis

signatory_name: name of lab employee to appear on certificate of analysis

signatory_title: title of lab employee to appear on certificate of analysis

signature: url to signature image for report

status: pass or fail integer id from status enum - see above

wet_weight: weight of aliquot as received

 

Mycotoxins

date_tested: date the sample was tested for this assay

digits: [default: 2] number of digits to display on certificate of analysis

footnote: any relevant footnote information associated with the assay - see above for details

input_units: [default: ppb] units test data is being submitted in select from allowed units

notes: optional testing notes for this assay

notes_2: optional testing notes for this assay

notes_3: optional testing notes for this assay

notes_4: optional testing notes for this assay

report_units: [default: ppb] the primary units displayed on the certificate of analysis

reported_as_wet: optional flag for if numbers are reported including moisture weight (wet) or converted (dry)

secondary_report_units: the secondary units displayed on the certificate of analysis

signatory_name: name of lab employee to appear on certificate of analysis

signatory_title: title of lab employee to appear on certificate of analysis

signature: url to signature image for report

status: pass or fail integer id from status enum - see above

 

Pesticides

date_tested: date the sample was tested for this assay

digits: [default: 3] number of digits to display on certificate of analysis

dry_weight: weight of aliquot after drying

footnote: any relevant footnote information associated with the assay - see above for details

input_units: [default: ppm] units test data is being submitted in select from allowed units

notes: optional testing notes for this assay

notes_2: optional testing notes for this assay

notes_3: optional testing notes for this assay

notes_4: optional testing notes for this assay

report_units: [default: ppm] the primary units displayed on the certificate of analysis

reported_as_wet: optional flag for if numbers are reported including moisture weight (wet) or converted (dry)

secondary_report_units: the secondary units displayed on the certificate of analysis

signatory_name: name of lab employee to appear on certificate of analysis

signatory_title: title of lab employee to appear on certificate of analysis

signature: url to signature image for report

status: pass or fail integer id from status enum - see above

volume: volume of the aliquot in the solution

wet_weight: weight of aliquot as received

 

Solvents

date_tested: date the sample was tested for this assay

digits: [default: 3] number of digits to display on certificate of analysis

dry_weight: weight of aliquot after drying

footnote: any relevant footnote information associated with the assay - see above for details

input_units: [default: ppm] units test data is being submitted in select from allowed units

notes: optional testing notes for this assay

notes_2: optional testing notes for this assay

notes_3: optional testing notes for this assay

notes_4: optional testing notes for this assay

report_units: [default: ppm] the primary units displayed on the certificate of analysis

reported_as_wet: optional flag for if numbers are reported including moisture weight (wet) or converted (dry)

secondary_report_units: the secondary units displayed on the certificate of analysis

signatory_name: name of lab employee to appear on certificate of analysis

signatory_title: title of lab employee to appear on certificate of analysis

signature: url to signature image for report

status: pass or fail integer id from status enum - see above

wet_weight: weight of aliquot as received

 

Terpenes

container_description: Description of container (eg. bottle, box, tin)

date_tested: date the sample was tested for this assay

digits: [default: 2] number of digits to display on certificate of analysis

dry_weight: weight of aliquot after drying

footnote: any relevant footnote information associated with the assay - see above for details

input_units: [default: %] units test data is being submitted in select from allowed units

ml_weight: the weight in grams of 1ml of sample when any unit fields are 'mg/ml'

notes: optional testing notes for this assay

notes_2: optional testing notes for this assay

notes_3: optional testing notes for this assay

notes_4: optional testing notes for this assay

report_units: [default: %] the primary units displayed on the certificate of analysis

reported_as_wet: optional flag for if numbers are reported including moisture weight (wet) or converted (dry)

secondary_report_units: the secondary units displayed on the certificate of analysis

servings_per_container: Number of servings per container

signatory_name: name of lab employee to appear on certificate of analysis

signatory_title: title of lab employee to appear on certificate of analysis

signature: url to signature image for report

status: pass or fail integer id from status enum - see above

unit_description: definition of one unit when any unit fields are 'mg/unit'

unit_weight: the weight in grams of the whole unit submitted for sampling when any unit fields are 'mg/unit'

units_per_serving: Number of units per serving

volume: volume of the aliquot in the solution

wet_weight: weight of aliquot as received

 

Water Activity

date_tested: date the sample was tested for this assay

digits: [default: 5] number of digits to display on certificate of analysis

footnote: any relevant footnote information associated with the assay - see above for details

input_units: [default: aw] units test data is being submitted in select from allowed units

notes: optional testing notes for this assay

notes_2: optional testing notes for this assay

notes_3: optional testing notes for this assay

notes_4: optional testing notes for this assay

report_units: [default: aw] the primary units displayed on the certificate of analysis

reported_as_wet: optional flag for if numbers are reported including moisture weight (wet) or converted (dry)

secondary_report_units: the secondary units displayed on the certificate of analysis

signatory_name: name of lab employee to appear on certificate of analysis

signatory_title: title of lab employee to appear on certificate of analysis

signature: url to signature image for report

status: pass or fail integer id from status enum - see above