Magnet Max allows developers to add bookmarks to channels. These bookmarks can be used to reference or tag important items in a channel. A common use case is bookmarking messages. This allows a user to quickly find messages. Bookmarks can be used to bookmark attachments as well. For the examples below we will focus on bookmarking messages.
A bookmark simply stores a reference to an object; the reference can be retrieved later on as needed. Let’s say we already have a message. We can add a reference to it:
We now have successfully bookmarked the message. Here's how to update it:
There are a few ways to retrieve bookmarks.
To retrieve a list of bookmarks:
To retrieve bookmarks by object ID (in this case, channel ID):
This final example shows how to delete a bookmark: