Skip to main content

API Documentation

FairTest provides a REST API for integrating your drug and alcohol testing platform with your existing HR systems, payroll software, safety management tools, and custom internal workflows.

API Reference

Full API documentation, including endpoints, request/response schemas, and interactive examples, is available at:

FairTest API Reference

The API reference includes detailed descriptions of every endpoint, example requests and responses, and the ability to test API calls directly from your browser.

What You Can Do with the API

The FairTest API allows you to programmatically:

  • Selections — create and run random drug and alcohol testing selections, retrieve selection pools, and manage selection statuses
  • Tests — log test results, update test records, retrieve test history, and query test data with filters (by employee, location, date range, result, status)
  • Employees — create, update, and retrieve employee records, manage active/inactive status, and sync employee rosters from external systems
  • Reports — query compliance data, test statistics, positive result registers, and tester activity
  • Setup data — manage locations, departments, job classifications, pay types, and test types

Common Integration Scenarios

  • HR system sync — automatically create and update employees in FairTest when your HR system changes
  • Safety management platforms — pull test results and compliance data into your safety management software
  • Custom dashboards — build internal reporting dashboards using FairTest data
  • Automated selections — trigger random selections on a schedule using your own automation tools
  • Payroll integration — sync employee data between FairTest and your payroll provider
  • Incident management — automatically create a for-cause selection when an incident is logged in your safety system

Authentication

API requests are authenticated using Bearer tokens. Include your FairTest session token in the Authorization header of each request:

Authorization: Bearer your-token-here

All API requests must be made over HTTPS. Unauthenticated requests will be rejected.

Rate Limits and Best Practices

  • Use pagination when retrieving large datasets
  • Cache responses where appropriate to reduce API calls
  • Handle errors gracefully — check HTTP status codes and error messages in responses

Getting Help

If you have questions about using the API, need support with your integration, or want to discuss a custom integration scenario, contact us at support@fairtest.com.au.


Related Articles: