Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Below API can be used to execute any AQL and obtain the desired results. AQL is custom query language built-in OpenSpecimen to allow power users to perform complex queries on data without requiring to know anything about the OpenSpecimen data model.

ItemValue
HTTP MethodPOST
URI/rest/ng/query
Body


Code Block
{
  "cpId": <cpId>,
  "aql": <AQL>,
  "wideRowMode": <OFF|SHALLOW|DEEP>,
  "outputColumnExprs": <true|false>,
  "outputIsoDateTime": <true|false> 
}


ResponseJSON containing desired results

Parameters

ParameterDescription
cpIdCollection protocol ID. If specified, limits the results to specified CP records.
aqlAQL string that needs to be executed
wideRowMode

Specifies whether multi-valued attributes result in a single row or one row per value.

outputColumnExprsSpecifies whether the column labels or AQL expression needs to be included in the query response
outputIsoDateTimeSpecifies how the date column values needs to be serialised in the query response. If true, then date/time values are serialised using ISO format: yyyy-MM-dd'T'HH:mm:ss'Z'. Otherwise, date/time values are serialised using the format specified in OS locale settings


Example

Given below is an example query request to obtain count of aliquots by visit dates:

...