Get Incident Comments

This endpoint retrieves all Comments of an Incident.

Request

To retrieve all Comments of an Incident please make a GET request to the following URL:

HTTP MethodURL
GEThttps://industrial.api.ubidots.com/api/v2.0/incidents/<incident_id>/comments/

Path Parameters

ParameterTypeDescription
incident_idStringThe id of the Incident. Incidents have no label, so the ~label form is not supported

Query Parameters

ParameterTypeDescription
pageIntegerPage number. Default 1
page_sizeIntegerResults per page. Default 50, max 200
sort_byStringComma-separated fields, prefix - for descending. Default -createdAt. Allowed: id, context__message, context__username, createdAt; any other field is ignored
searchStringCase-insensitive search over the message and the username. Also search__<lookup> with the text lookups
fieldsStringComma-separated list of fields to keep in the response, e.g. id,name,state
omitStringComma-separated list of fields to drop from the response

Filters

Filter AttributeFilter TypeAvailable FiltersReference
idIdexact, inField Filter Id
messageStringexact (case sensitive), iexact (case insensitive), contains, icontains (case insensitive), startswith, istartswith (case insensitive), endswith, iendswith (case insensitive)Field Filter String
usernameStringexact (case sensitive), iexact (case insensitive), contains, icontains (case insensitive), startswith, istartswith (case insensitive), endswith, iendswith (case insensitive)Field Filter String
createdAtDateexact (=), isnull, date, year, month, day, hour, and each unit with gt, gte, lt, lte and rangeField Filter Date

Header

ParameterRequired?Description
X-Auth-TokenYesAuthentication Token of account
$ curl -X GET 'https://industrial.api.ubidots.com/api/v2.0/incidents/<incident_id>/comments/?message__icontains=technician' \
 -H 'X-Auth-Token: oaXBo6ODhIjPsusNRPUGIK4d72bc73'
{
    "count": 1,
    "next": null,
    "previous": null,
    "results": [
        {
            "id": "689e2f1a246a939d3a0c2f10",
            "message": "Technician dispatched",
            "username": "jane.doe",
            "createdAt": "2026-11-20T14:20:45.118000Z"
        }
    ]
}
{
    "code": 401001,
    "message": "Authentication credentials were not provided.",
    "detail": "Authentication credentials were not provided."
}
{
    "code": 404001,
    "message": "The request was not found."
}

Response

An object with an array results of Comment objects, newest first.

Any user who can see the Incident can read, add, update and delete its Comments.