question

Caleb Bergman avatar image
Caleb Bergman asked ·

Glip API, read/unread messages

There are API endpoints to mark messages chats read and unread. The Mark Chat as Read endpoint’s description states, “Sets the specified chat status to 'Read' for the current user.”


The GetChats documentation states that a chat can have a status property, but only for ‘Team’ chats; the Team status.


As you are evidently unable to use the status property to know a chat’s read status, and there is no readStatus on a chat like there is for messages in the SMS & Fax API, how is one suppose to know when a particular chat/conversation is read or unread?

glip api
1 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

1 Answer

· Write an Answer
Phong Vu avatar image
Phong Vu answered ·

Just check with the team. Unfortunately, there is no read/unread message attribute in Glip message.

3 comments
1 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

That is very unfortunate indeed. I have witnessed this functionality in the RC Desktop application as well as the Embeddable project, so I know it's possible.

1610735210009.png

Looking closer at the Embeddable project it would appear this is being handled in localStorage by recording a datestamp of the latest post that has been read in a given chat. I'll have to build something up like that until if/when the Glip API supports it.

Thank you.

0 Likes 0 ·
1610735210009.png (14.9 KiB)

This is the engineer explained to me:

There is no read/unread attribute per message, but groups have the number of messages, and each user for every group has "last read message." All together it allows to calculate unread message count per group and create "unread from here" functionality. Nothing of this is exposed via public API.

0 Likes 0 ·

Thank you for the follow up Phong Vu.

Hmmmm, I'm not seeing any message count on the response from GetGroups or GetGroup, nor from GetChats for a chat type of "Group." Nor am I seeing a "last read message" property for any User on any of the API calls I've tried. To my understanding the Group APIs are deprecated anyhow.

1610743000348.png

GetGroup

{
  "id": "",
  "name": null,
  "description": null,
  "type": "Group",
  "status": "Active",
  "members": ["","",""],
  "isPublic": null,
  "creationTime": "2021-01-15T20:22:17.368Z",
  "lastModifiedTime": "2021-01-15T20:22:17.368Z"
}

I should be able to mimic how the Embeddable project appears to do it. It'll just be local to the machine instead of following the User device to device.

0 Likes 0 ·
1610743000348.png (3.9 KiB)

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Work together.
From anywhere.

Team messaging, video meetings
and phone - all in one app.


Get the new RingCentral app