Generic parameters for queries

Common parameters

These parameters can be combined with GET request resources of Competition Labs. Below parameters can be used in any combination among themselves.

*some parameters can be used with POST request.

Parameter
Parameter Type
Description
_limit
Integer

Used for pagination. Setting the limit value will cause the system to limit the number of records returned to the specified number.

_skip
Integer

Used for pagination. Setting the skip value will cause the system to return records from the specified position onwards.

EXAMPLE Returns the second page of results for members

https://<apphost>.competitionlabs.com/api/<your-space-name>/members?_limit=5&_skip=5

_sortByFields
String

Enables sorting of results based on fields and order specified.

Syntax: sortByFields=<field-to-sort-on>:<order>

Acceptable order: asc, desc

EXAMPLE The query will return scores sorted by trasnactionTimestamp (time stamp from customer system) in descending order.

https://<apphost>.competitionlabs.com/api/<your-space-name>/scores?_sortByFields=transactionTimestamp:desc,created:asc

=

==

String

Single '=' sign usage will work as a 'should/OR' action and '==' will work as a 'must/AND' action

Single equals sign usage has two types of applications in formulating API queries:

  1. assigning values to predefined/reserved parameters like _skip, _limit, _lang, _sortByFields, _uomKey, _include

  2. assigning values to model based parameters (Example: name, transactionTimestamp, options.limitEntrantsTo etc.)

EXAMPLE Returns all competitions in "Ready" state that have either a group1 or group2 entrant limitation

https://<gatewayhost>.competitionlabs.com/api/v1/<your-space-name>/competitions?_skip=0&_limit=100&status==Ready&options.limitEntrantsTo=group1,group2

<=

<==

*(extention to
single and double
equals)

Integer

Double

Float

DateTime

Single '=' sign usage will work as a 'should/OR' action and '==' will work as a 'must/AND' action

The less than equal filter can be used on fields with a data type of integer, long, double, float, date, time or date-time. The filter will return all matching records that are equal to or less than the specified field value.

EXAMPLE Returns all events which were uploaded to CL before 17:38 9th of February 2016 (defaults to 20 results).

https://<apphost>.competitionlabs.com/api/<your-space-name>/events?transactionTimestamp<==2016-02-09T17:38:08.328

>=

>==

*(extention to
single and double
equals)

Integer

Double

Float

DateTime

Single '=' sign usage will work as a 'should/OR' action and '==' will work as a 'must/AND' action

The greater than equal filter can be used on fields with a data type of integer, long, double, float, date, time or date-time. The filter will return all matching records that are equal to or greater than the specified field value.

EXAMPLE Returns all scores which were uploaded to CL after 17:38 8th of February 2016.

https://<apphost>.competitionlabs.com/api/<your-space-name>/events?transactionTimestamp>==2016-02-08T17:38:08.328

_hasNoValuesFor

Enabled the usage of exists check agains fields

Syntax: _hasNoValuesFor=<field-to-check>:<ternary-operator>

Acceptable Ternary Operators: must, should

Acceptable order: asc, desc

EXAMPLE Returns all messages for a user that do not have an expiry field

https://<apphost>.competitionlabs.com/api/v1/<your-space-name>/members/reference/jim-QziWx2MBHqy04gzwnZj4/messages?_hasNoValuesFor=expiry:must