For example:
\["id","=", 2\]
Matching operators supported:
String operators:
= equals to
like like
examples:
\["firstName","=", "john"\]
\["email","like", "j%acme.com"\]
Integer operators:
= equals to
< less than
> greater than
examples:
\["age","=", 45\]
\["weight","<", 110\]
\["size",">", 42\]
Date operators:
= equals to
< before
> after
examples:
\["lastModified","=", "2009-08-20T00:00:00Z"\]
\["created","<", "2009-01-12T12:00:00Z"\]
\["deleted",">", "2008-08-21T08:00:00Z"\]
Notes: all date value should be in ISO 8601 format.
Parameters:
\{
"match":\{list of attributes to be matched\}
"return":\[array of attributes to be returned\]
"sort": attribute to be sorted by
"order":"asc" | "desc"
"max": the maximum numbers of records to return
"offset": the offset
\}
Response: \{"result":\[array of list of attributes\]\}
+Example+
Method:/user/search
Parameters:
\{
"match":
\[
\["domain.id", "=", 2\],
\["lastname", "=", "smith"\],
\["email", "like", "[%@acme.com|mailto:%25@acme.com]"\]
\],
"return":\["firstname", "lastname", "email", "phone"\],
"sort":"lastname",
"order":"asc",
"max": 20,
"offset": 10
\}
Response:
\{
"error":0,
"result":
\{
"total": 20,
"rows":
\[
\{
"firstname":"John",
"lastname":"Smith",
"email":"js@acme.com",
"phone":"447974321234",
\},
\{
"firstname":"David",
"lastname":"Smith",
"email":"ds@acme.com",
"phone":"447974234975",
\}
\]
\}
\}
\\
// a failed response
\{
"error":101,
"message":"user not found"
\}
-------------------------------------------------------------------
Method:/token/search
Parameters:
\{
"match":
\[
\["user.id", "=", 2\]
\["category", "=", "OTP"\]
\],
"return":\["serial"\],
"sort":\["serial"\]
\}
Response:
\{
"result":
\{
"total":4,
"rows":
\[
\{"serial":"77004155"\},
\{"serial":"77004245"\},
\{"serial":"77004266"\},
\{"serial":"77004321"\},
\]
\}
\}
\\ |