Tag GET Resources

List of Tags

GET /tags
Parameter Type Default Required Description
limit int 10 Sets how many tags are returned at once.
offset int 0 Offset from the first tag.
query string Return only tags which contain the query parameter as a substring. The result is ordered by relevance (unless a sort parameter overrides this behaviour).
query_type string infix One of prefix|infix|postfix. Determines if tags must start with (prefix), contain (infix), or end with (postfix) the substring specified in the query parameter.
sort string encounter.desc Specify the criteria the result is sorted by. The allowed sort criteria are id, label, encounter. The format is CRITERION.DIRECTION,CRITERION.DIRECTION.

This parameter overrules the result ordering of the query parameter.

Returns a paginated list of tags, sorted by encounter if query is not specified, sorted alphabetically otherwise.

Response

{
    "total": 1221,
    "_links": {
        "self": {
            "href": "/api/v1/tags?limit=10&offset=0"
        },
        "next": {
            "href": "/api/v1/tags?limit=10&offset=1"
        },
        "last": {
            "href": "/api/v1/tags?limit=10&offset=122"
        }
    },
    "items": [
        {
            "tag": "Sherlock",
            "id": 27,
            "encounter": 736,
            "image": "https://cdn.example.com/avatar/default/2d/1b84215e2f035a22f6fec213d3b1d9.jpg",
            "excluded_from_suggestions": false,
            "created": "2011-12-12T15:35:25.000Z"
        },
        {
            "tag": "Baker Street",
            "id": 151,
            "encounter": 331,
            "image": null,
            "excluded_from_suggestions": true,
            "created": "2011-12-13T17:57:34.000Z"
        },
        ...
    ]
}

Tag by ID

GET /tags/:ID

Returns a single tag.

Response

{
    "tag": "Sherlock",
    "id": 27,
    "encounter": 736,
    "image": "https://cdn.example.com/avatar/default/2d/1b84215e2f035a22f6fec213d3b1d9.jpg",
    "excluded_from_suggestions": false,
    "created": "2011-12-12T15:35:25.000Z"
}