A guide to more specific querying on GET /users
or GET /users/:id
endpoints
Querying by External Properties
If you provide external properties field, you can store any JSON structure for a user, but in order to query the contents, you should adhere to a certain convention. There are 3 suggested types which work best for querying.
External Properties Value | Queries |
---|---|
{ "a": 1, "b": 2, "c": 3 } | GET /users?external_properties={"b":2} GET /users/{"b":2}?by_external_properties=true |
[ { "a": 1 }, { "b": 2 }, { "c": 3 } ] | GET /users?external_properties=[{"b":2}] GET /users/[{"b":2}]?by_external_properties=true |
[ "A", "B", "C" ] | GET /users?external_properties="A" GET /users/"A"?by_external_properties=true |
NOTE: Always make sure to include quotes " "
for string only values as the value is treated and parsed as valid JSON, therefore 1
will be considered as number, not as a string. If you want it to be considered as string, always enclose it with quotes as "1"
.
NOTE: You might also want to consider escaping your URL, e.g. for GET /users?external_properties={"b":2}
and escape it as GET /users?external_properties=%7B%22b%22%3A2%7D