question

Caleb Bergman avatar image
Caleb Bergman asked Caleb Bergman edited

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?

rest api
1 |3000

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

1 Answer

Phong Vu avatar image
Phong Vu answered Caleb Bergman edited

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

3 comments
1 |3000

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

Caleb Bergman avatar image Caleb Bergman commented ·

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)
Phong Vu avatar image Phong Vu ♦♦ Caleb Bergman commented ·

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 ·
Caleb Bergman avatar image Caleb Bergman Phong Vu ♦♦ commented ·

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)

Developer sandbox tools

Using the RingCentral Phone for Desktop, you can dial or receive test calls, send and receive test SMS or Fax messages in your sandbox environment.

Download RingCentral Phone for Desktop:

Tip: switch to the "sandbox mode" before logging in the app:

  • On MacOS: press "fn + command + f2" keys
  • On Windows: press "Ctrl + F2" keys