Find by tag

ENDPOINT /api/v0-user/find-by-tag (GET only)

A tag query must be included when using this end point.

Tag queries are included in the parameters of the request, and can include multiple tags. For each tag you want to query on, the name of the paramter should be the name of the tag, prefixed by tag:. The value of the parameter should be the value of the tag for the users you care about. For instance, a username query could look like: tag:username=abc123. The username tag is special, and is used for uniquely identifying users throughout the system.

Response

This request can respond with following kinds, in addition to the generic kinds (see Introduction):

Kind Meaning HTTP status
haplo:api-v0:user:find-by-tag The request was successful and all users with tags matching the tag query have been returned 200
haplo:api-v0:user:no-tag-query-provided A tag query was expected for this request, but was not provided. 400
haplo:api-v0:user:no-user-found No user could be found that matched the tag query provided. 404

Along with the standard success and kind fields (see Introduction for explanation), the response has the following structure:

  • users

The users field is an array of the IDs of all users (active or not) who have tags matching the tag query. This array does not include groups.

Example response

{
    "success": true,
    "kind": "haplo:api-v0:user:find-by-tag",
    "users": [123, 456, 789]
}