The Userback API utilizes Filtering and Sorting based on Microsoft API guidelines syntax, excluding the use of $
.
This allows for the use of the following operators:
eq
- Field equals the valuene
- Field is not equal to the valuege
/gt
Greater (than) the valuele
/lt
Less (than) the valueand
/or
- Logical connectives for multiple conditions(
/)
- Allows grouping/ordering of more complex conditional logic
Filtering
Filtering results can be done on all list endpoints using the filter
query URL parameter (eg: GET /rest/x.x/feedback/?filter=xxx
)
In order to filter records you can perform an equality check like so:
https://api.userback.io/rest/1.0/feedback?filter=name eq 'Joe'
Or utilizing gt
to find all feedback with more than 5 votes:
https://rest.userback.io/1.0/feedback?filter=voteCount gt 5
Filters can also be combined using the and
/or
operators:
//rest.userback.io/1.0/feedback?filter=voteCount gt 5 and feedbackType eq 'Bug'
String Quotations
Note that all string value quotations must use
'
, not"
.
For example:?filter=name eq 'Joe Doe'
This also is required when it comes to
true
andfalse
, which are reserved keywords for booleans.
Sorting and Ordering
Sorting is achieved through the sort
query URL parameter. If we wanted to sort all feedback from mostly recently modified to least recently, we could use:
https://rest.userback.io/1.0/feedback?sort=modified,desc
Only one field can be sorted at a time.