Get DM Counters
    • Dark
      Light
    • PDF

    Get DM Counters

    • Dark
      Light
    • PDF

    Article summary

    Get
    /api/v1/im.counters

    Gets counters and information of direct messages. Permission required: view-room-administration.

    Changelog

    VersionDescription
    0.65.0Added
    Header parameters
    X-Auth-Token
    stringRequired

    The authToken of the authenticated user.

    ExampleRScctEHSmLGZGywfIhWyRpyofhKOiMoUIpimhvheU3f
    X-User-Id
    stringRequired

    The userId of the authenticated user.

    ExamplerbAXPnMktTFbNpwtJ
    Query parameters
    roomId
    stringRequired

    The DM room ID

    userId
    string

    The user ID to provide counters for.

    Responses
    200

    OK

    Note

    • joined: Boolean flag that shows that user has joined the room or not.
    • members: Count of current room members.
    • unreads: Count of unread messages for specified user (calling user or provided user ID).
    • unreadsFrom: Start date-time of unread interval for specified user.
    • msgs: Count of messages in the room.
    • latest: End date-time of unread interval for specified user (or date-time of last posted message).
    • userMentions - Count of user mentions in messages.
    Example 1
    {
      "joined": true,
      "members": 2,
      "unreads": 4,
      "unreadsFrom": "2023-10-30T20:30:47.975Z",
      "msgs": 10,
      "latest": "2023-10-30T20:37:17.160Z",
      "userMentions": 0,
      "success": true
    }
    object
    joined
    boolean
    members
    integer
    unreads
    integer
    unreadsFrom
    string
    msgs
    integer
    latest
    string
    userMentions
    integer
    success
    boolean
    400

    Bad Request

    Example 1
    {
      "success": false,
      "error": "Query param \"roomId\" is required [error-room-param-not-provided]",
      "errorType": "error-room-param-not-provided"
    }
    object
    success
    boolean
    error
    string
    errorType
    string
    401

    Unauthorized

    Authorization Error
    {
      "status": "error",
      "message": "You must be logged in to do this."
    }
    object
    status
    string
    message
    string

    Was this article helpful?

    What's Next
    Changing your password will log you out immediately. Use the new password to log back in.
    First name must have atleast 2 characters. Numbers and special characters are not allowed.
    Last name must have atleast 1 characters. Numbers and special characters are not allowed.
    Enter a valid email
    Enter a valid password
    Your profile has been successfully updated.