1. Home
  2. API
  3. API Filtering

API Filtering

You can use the API to conduct basic filtering, reducing the datasets into a window of time, or per users/templates. You can also use multiple of these filter parameters per query. Please review the two updated endpoints below:

Schedules:

Template Name: 

  • Param: ‘template__name’
  • Example: ‘template__name=Example’
  • URL Example: https://api.auditcomply.com/schedules/?template__name=Example

Schedule to user: 

  • Param: ‘who__username’ and ‘who__email’
  • Example: ‘who__username=test’ and ‘who__email=test@auditcomply.com’
  • URL Example: https://api.auditcomply.com/schedules/?who__username=test

Status: 

  • Param: ’status’
  • Values: [‘PENDING’, ‘INPROGRESS’, ‘COMPLETED’, ‘CLOSED’, ‘OVERDUE’]
  • Example: ‘status=INPROGRESS’
  • URL Example: https://api.auditcomply.com/schedules/?status=INPROGRESS

When: 

  • Param: ’when’
  • Extra values: ‘year/month/day’, ‘gt’ (greater), ‘lt’ (lower)
  • Example: ‘when__year__gt=2018’ (get all schedules greater than 2018
  • URL Example: https://api.auditcomply.com/schedules/?when__year__gt=2018

Audits:

Name: 

  • Param: ‘name’
  • Example: ‘name=Example’ (the audit/template name)
  • URL Example: https://api.auditcomply.com/audits/?name=Example

Auditor: 

  • Param: ‘auditor__username’ and ‘auditor__email’
  • Example: ‘auditor__username=test’ and ‘auditor__email=test@auditcomply.com’
  • URL Example: https://api.auditcomply.com/audits/?auditor__username=test

State: 

  • Param: ’state’
  • Values: [‘INPROGRESS’, ‘INREVIEW’, ’READYTOCLOSE’, ‘COMPLETED’, ‘CLOSED’]
  • Example: ‘state=INPROGRESS’
  • URL Example: https://api.auditcomply.com/audits/?state=INPROGRESS

Status: 

  • Param: ’status’
  • Example: ‘status=Fail’ (Grade)
  • URL Example: https://api.auditcomply.com/audits/?status=Fail

Published: 

  • Param: ’published’
  • Extra values: ‘year/month/day’, ‘gt’ (greater), ‘lt’ (lower)
  • Example: ‘published__year__gt=2018’ (get all audits submitted greater than 2018)
  • URL Example: https://api.auditcomply.com/audits/?published__year__gt=2018

Was this article helpful?

Related Articles