Messages Lookup

Endpoints:

GET /channels/{channel_id}/messages/{message_id}

Scope: messages

Retrieve a message from a channel. The requesting user must have access to the channel or have created the message.

URL Parameters

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

Returns the requested message.

"call for example 1"

GET /channels/{channel_id}/messages/{message_id}/thread

Token: user

Scope: messages

Retrieve messages in the same thread of a channel. All messages will have the same thread_id (they are all replies to the same post, or is not a reply to any post). The requesting user must have access to the channel.

URL Parameters

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

Returns a list of messages.

"call for example 2"

GET /channels/messages

Scope: messages

Retrieve a list of specified messages. Will only return the first 200 found.

Query String Parameters

Name Description
ids Comma-separated list of message IDs.
Example
curl "https://api.pnut.io/v0/channels/messages?ids=4,11,12" \
    -H "Authorization: Bearer ${ACCESS_TOKEN}" \
    -H "X-Pretty-Json: 1"

Returns a list of the messages found.

"call for example 3"

GET /channels/{channel_id}/messages

Scope: messages

Retrieve paginated messages from a channel.

URL Parameters

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

Returns a list of messages from the channel.

"call for example 4"

GET /users/me/messages

Scope: messages

Retrieve a paginated list of messages created by the authenticated user.

Example
curl "https://api.pnut.io/v0/users/me/messages" \
    -H "Authorization: Bearer ${ACCESS_TOKEN}" \
    -H "X-Pretty-Json: 1"

Returns a list of messages.

"call for example 5"