Sticky Messages

Endpoints:

"Sticky" messages are like bookmarks for a channel, but they are per-channel, not per-user. They will have is_sticky: true. The channel also has an indicator, channel.has_sticky_messages that will tell if the channel has sticky messages.

Users with full access to a channel are able to sticky and un-sticky messages in the channel.

In Private Message channels (type io.pnut.core.pm), anyone can stick and un-sticky messages.

GET /channels/{channel_id}/sticky_messages

Token: user

Scope: messages

Retrieve sticky messsages in a channel. The requesting user must have access to the channel.

Note that the pagination_id and min_id and max_id will change as users sticky and un-sticky messages.

URL Parameters

Name Description
channel_id ID of the channel to retrieve messages from
Example
curl "https://api.pnut.io/v1/channels/5/sticky_messages" \
    -H "Authorization: Bearer ${ACCESS_TOKEN}" \
    -H "X-Pretty-Json: 1"

Returns a list of messages.

{
    "meta": {
        "more": false,
        "max_id": "0",
        "min_id": "0",
        "code": 200
    },
    "data": [
        {"...Message Object..."}
    ]
}

PUT /channels/{channel_id}/messages/{message_id}/sticky

Token: user

Scope: messages

Sticky a message.

URL Parameters

Name Description
channel_id ID of the channel the message is in
message_id Message to sticky
Example
curl "https://api.pnut.io/v1/channels/5/messages/13/sticky" \
    -H "Authorization: Bearer ${ACCESS_TOKEN}" \
    -X PUT \
    -H "X-Pretty-Json: 1"

Returns the stickied message.

{
    "meta": {
        "code": 200
    },
    "data": {"...Message Object..."}
}

DELETE /channels/{channel_id}/messages/{message_id}/sticky

Token: user

Scope: messages

Un-sticky a message.

URL Parameters

Name Description
channel_id ID of the channel the message is in
message_id Message to un-sticky
Example
curl "https://api.pnut.io/v1/channels/5/messages/13/sticky" \
    -H "Authorization: Bearer ${ACCESS_TOKEN}" \
    -X DELETE \
    -H "X-Pretty-Json: 1"

Returns the un-stickied message.

{
    "meta": {
        "code": 200
    },
    "data": {"....Message Object..."}
}