Previously: POST /users/me/topics/{topicId}/markread

Mark the messages as read for a specific space (topic) to NOW if readTime not defined in the payload.

Note 1: For performance purposes, Spaces has put lower throttling rules around this API, so apps should

Note 2: To reduce traffic to server, the app should call this API 5sec after without the readTime upon the first message read. So any subsequent messages received until the markread api call will be considered as read.

URL Parameters

NameDescriptionLocationRequiredDefault Value
spaceIdUnique identifier of the space (topic) to modify.pathYes

Body Parameters

NameDescriptionJSON typeRequiredDefault Value
readTimeUTC time formatNoNote: if not set, server would assume readTime as now

Authentication

JwtAuthenticator, Oauth2Authenticator, AnonymousAuthenticator

Authorization

PERM_TOPIC_UPDATE

Example Request

URL

For Production: POST https://spacesapis.avayacloud.com/api/users/me/spaces/{spaceId}/markread
For Staging: POST https://loganstagingapis.esna.com/api/users/me/spaces/{spaceId}/markread

Headers

Authorization: "jwt eyJhbGciOiJSUzI1NiIsIdfgdfgnR5cCI6IkpXVCJ9.eyJ1c2VyX2lkX3NpZyI6ImxPWHpxNzVzR3J3X0xwWEMyRGRMakhyYXJlWVhyTzFMdEZHZkhkOWNkTXciLCJwcm9kdWN0X3R5cGUiOiJhY2NvdW50cyIsImxhc3R1cGRhdGV0aW1lIjoiMjAxNy0wMS0zMFQxMzo1ODo0Ny4yMDYiLCJpc3MiOiJ6YW5nLmlvIiwicHVibGlja2V5aWQiOiJhZ3h6Zm05dVpYTnVZVEl3TVRSeUdnc1NEVWRLZDNSUWRXSnNhV05MWlhrdfgdWdJQ2dsUEtFakFvTSIsImV4cCI6MTQ5NTM5MTIwMywidXNlcl9pZCI6ImFneHpmbTl1WlhOdVlUSXdNVFJ5RVFzU0JGVnpaWElZZ0lEQXMtX25fUW9NIiwidmVyIjoiMi4wIn0.SqZpw1uPIebqW3qlDsm0-DWYFKEH0SgPwtD-tSESWOF-5hLkZMqJH28ooWux2S7s9riIew7pTVPnZpTgJa5zHcEAG0gXSEJVOqmpGp_4ufM8YtZoZMpBFjyAkwyAt-ILkGUYIo0GU5WyzMPLV8YLXfgdfgOgkE2MGGOajBkjPmC2Db3pA0D0M9k-21EL1gwWBC5YIq0PDAkgulegwl6khRmB8irJQ-dfg-d-KV9eYfFpsCdJKRGzSfqg"

Or

Authorization: "bearer f746696f5de4528u128ae2f274eea253e8a7943a"

Example Request Body

{}

Socket Event

Upon success of markread api a socket event is sent to all user's app instances, so all instances would reset their virtual Unread Messages Count.


{
  category: "topic.markread"
  content: {
    messagesLastReadTime: "2019-11-01T16:47:39.528Z", 
    unreadMessagesCount: 0
    }
  topicId: ":spaceId"
}