Search#
GET https://login.company.com/blitz/api/v3/users
Search for an account.
A search query in Resource Query Language (RQL) format is passed to query. Operations:
and
- simultaneous execution of search conditions;or
– alternative fulfillment of search conditions (for example, search by different attributes);eq
– checking the equality condition.
When searching for an attribute with a string value, it is recommended to explicitly specify the value type. For example, string:02142527602
.
Attention
If the search attribute is a string containing special characters such as &|()=<>,
, then it is necessary to adhere to the following algorithm for escaping and encoding parameters:
To encode all attribute values – to escape the special characters present in the parameters. For example, if you are searching by phone +7(999)1234567, then the parameter value should be converted to the value
+7%28999%291234567
.Assemble a common string to pass as a query parameter to the query. For example,
phone_number=+7%28999%291234567
.Execute the URL Encode of the parameter value. For example, the parameter value is
phone_number%3D%2B7%2528999%25291234567
.
Examples
Simple search query
GET /blitz/api/v3/users?query=eq(phone_number,string:79991234567) HTTP/1.1
Authorization: Bearer eyJraWQiOiJkZWZhdWx0IiwiYWxnIjoiUlMyNTYifQ.eyJzY29wZSI6ImJsaXR6X2FwaV9zeXNfdXNlcnMiLCJqdGkiOiJuWWtKRER2RGhMdVZucl9SYUlOQmdnUldWLTUxbmtJYVdPUGtRRU4tTE93IiwiY2xpZW50X2lkIjoidGF0LWFwaS10ZXN0IiwiZXhwIjoxNzE5NDk5OTY4LCJpYXQiOjE3MTk0ODk5NjgsImF1ZCI6WyJ0YXQtYXBpLXRlc3QiXSwiY3JpZCI6IjAiLCJpc3MiOiJodHRwczovL2JpcC1kZXYxLnJlYXhvZnQucnUvYmxpdHovb2F1dGgifQ.QdQ4tGBeblW46BD2QqwKALWaL1nMR7e6dsAYQYJpuortOz8oy40wfwntWpbHHHDtvyAOGbl4d3pmim9kwnE19bdxQLfy9odCQICBlBjRgfWMJS2xnJ2VtxN_wiHa3SfvcY3HyKJDDD_PLLte3ujCcPZdyfZiNrQe04KR9d6hUDhBIogrqYKcSh6OD_-81aZxidoEI_8uF0n0BPZGAoBZwyEesip1YSULwNhDof7bvp_nLDx8BadEySdHZMEbq7K5kP8jWuKU4oAy6FY2gbQseM27VhiKN5MGi_brPuirnU2Nt_wqu6x-YoHajMHWvSVUzrsTTc-MayqrIWy2wIeSYQ
[
{
"instanceId":"Mzg5…nU",
"attrs":{
"sub":"854436f6-af58-4a3f-8cb7-c2c441eb4a76",
"family_name":"Иванов",
"given_name":"Иван",
"middle_name":"Иванович",
"phone_number":"79991234567",
}
}
]
Complex search query
GET /blitz/api/v3/users?query=or(eq(phone_number,string:79991234567),eq(phone_number,string:79991112233)) HTTP/1.1
Authorization: Bearer eyJraWQiOiJkZWZhdWx0IiwiYWxnIjoiUlMyNTYifQ.eyJzY29wZSI6ImJsaXR6X2FwaV9zeXNfdXNlcnMiLCJqdGkiOiJuWWtKRER2RGhMdVZucl9SYUlOQmdnUldWLTUxbmtJYVdPUGtRRU4tTE93IiwiY2xpZW50X2lkIjoidGF0LWFwaS10ZXN0IiwiZXhwIjoxNzE5NDk5OTY4LCJpYXQiOjE3MTk0ODk5NjgsImF1ZCI6WyJ0YXQtYXBpLXRlc3QiXSwiY3JpZCI6IjAiLCJpc3MiOiJodHRwczovL2JpcC1kZXYxLnJlYXhvZnQucnUvYmxpdHovb2F1dGgifQ.QdQ4tGBeblW46BD2QqwKALWaL1nMR7e6dsAYQYJpuortOz8oy40wfwntWpbHHHDtvyAOGbl4d3pmim9kwnE19bdxQLfy9odCQICBlBjRgfWMJS2xnJ2VtxN_wiHa3SfvcY3HyKJDDD_PLLte3ujCcPZdyfZiNrQe04KR9d6hUDhBIogrqYKcSh6OD_-81aZxidoEI_8uF0n0BPZGAoBZwyEesip1YSULwNhDof7bvp_nLDx8BadEySdHZMEbq7K5kP8jWuKU4oAy6FY2gbQseM27VhiKN5MGi_brPuirnU2Nt_wqu6x-YoHajMHWvSVUzrsTTc-MayqrIWy2wIeSYQ
Search for a string containing special characters
GET /blitz/api/v3/users?query=phone_number%3D%2B7%2528999%25291234567 HTTP/1.1
Authorization: Bearer eyJraWQiOiJkZWZhdWx0IiwiYWxnIjoiUlMyNTYifQ.eyJzY29wZSI6ImJsaXR6X2FwaV9zeXNfdXNlcnMiLCJqdGkiOiJuWWtKRER2RGhMdVZucl9SYUlOQmdnUldWLTUxbmtJYVdPUGtRRU4tTE93IiwiY2xpZW50X2lkIjoidGF0LWFwaS10ZXN0IiwiZXhwIjoxNzE5NDk5OTY4LCJpYXQiOjE3MTk0ODk5NjgsImF1ZCI6WyJ0YXQtYXBpLXRlc3QiXSwiY3JpZCI6IjAiLCJpc3MiOiJodHRwczovL2JpcC1kZXYxLnJlYXhvZnQucnUvYmxpdHovb2F1dGgifQ.QdQ4tGBeblW46BD2QqwKALWaL1nMR7e6dsAYQYJpuortOz8oy40wfwntWpbHHHDtvyAOGbl4d3pmim9kwnE19bdxQLfy9odCQICBlBjRgfWMJS2xnJ2VtxN_wiHa3SfvcY3HyKJDDD_PLLte3ujCcPZdyfZiNrQe04KR9d6hUDhBIogrqYKcSh6OD_-81aZxidoEI_8uF0n0BPZGAoBZwyEesip1YSULwNhDof7bvp_nLDx8BadEySdHZMEbq7K5kP8jWuKU4oAy6FY2gbQseM27VhiKN5MGi_brPuirnU2Nt_wqu6x-YoHajMHWvSVUzrsTTc-MayqrIWy2wIeSYQ