Channel Subscribing

Subscribed channels act like an "inbox" of channels ordered by their most recent messages.

Endpoints:

GET /users/me/channels/subscribed

Token: user

Scope: messages

Retrieve a list of channels the authenticated user is subscribed to.

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

Returns a list of subscribed channels.

"call for example 1"

GET /channels/{channel_id}/subscribers

Scope: messages

Retrieve a list of users subscribed to a channel.

URL Parameters

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

Returns a list of users.

"call for example 2"

PUT /channels/{channel_id}/subscribe

Token: user

Scope: messages

Subscribe to updates from a channel. Subscribing unmutes it, if you were muting it.

URL Parameters

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

Returns the subscribed channel.

"call for example 3"

DELETE /channels/{channel_id}/subscribe

Token: user

Scope: messages

Delete a subscription for a channel. Unsubscribing also deletes any existing stream marker for the channel.

URL Parameters

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

Returns the unsubscribed channel.

"call for example 4"