Retrieve an “inbox” of the channels the user is currently subscribed to. This stream is ordered like an inbox with the stream containing the most recent post first.
The meta
response will contain unread counts for common channel types.
This endpoint responds to general Channel parameters.
Responses from this endpoint are paginated.
Method | URL | Token | Scope |
---|---|---|---|
GET | https://alpha-api.app.net/stream/0/channels | User |
public_messages or messages
|
curl -H "Authorization: Bearer <YOUR ACCESS TOKEN>" -H "X-ADN-Pretty-JSON: 1" \
"https://alpha-api.app.net/stream/0/channels"
{
"data": [
{
"counts": {
"messages": 42,
"subscribers": 43
},
"has_unread": false,
"id": "1",
"owner": "...user object...",
"is_inactive": false,
"readers": {
"any_user": false,
"immutable": false,
"public": true,
"user_ids": [
],
"you": true
},
"editors": {
"any_user": false,
"immutable": false,
"public": false,
"user_ids": [
],
"you": true
},
"recent_message_id": "231",
"recent_message": "...message object...",
"type": "com.example.channel",
"writers": {
"any_user": false,
"immutable": false,
"public": false,
"user_ids": [
],
"you": true
},
"you_can_edit": true,
"you_subscribed": true,
"you_muted": false,
"pagination_id": "146"
}
],
"meta": {
"code": 200,
"more": true,
"unread_counts": {
"net.app.core.pm": 5,
"net.app.core.broadcast": 3
},
"min_id": "146",
"max_id": "146"
}
}
Subscribe to a Channel. This adds it to your Channel stream. If a user has muted this Channel, this call will automatically unmute the Channel.
This endpoint responds to general Channel parameters.
Method | URL | Token | Scope |
---|---|---|---|
POST | https://alpha-api.app.net/stream/0/channels/{channel_id}/subscribe | User |
public_messages or messages
|
Name | Description |
---|---|
channel_id |
The id of the Channel to subscribe to. |
curl -X POST -H "Authorization: Bearer <YOUR ACCESS TOKEN>" -H "X-ADN-Pretty-JSON: 1" \
"https://alpha-api.app.net/stream/0/channels/1/subscribe"
{
"data": {
"counts": {
"messages": 42,
"subscribers": 43
},
"has_unread": false,
"id": "1",
"owner": "...user object...",
"is_inactive": false,
"readers": {
"any_user": false,
"immutable": false,
"public": true,
"user_ids": [
],
"you": true
},
"editors": {
"any_user": false,
"immutable": false,
"public": false,
"user_ids": [
],
"you": true
},
"recent_message_id": "231",
"recent_message": "...message object...",
"type": "com.example.channel",
"writers": {
"any_user": false,
"immutable": false,
"public": false,
"user_ids": [
],
"you": true
},
"you_can_edit": true,
"you_subscribed": true,
"you_muted": false
},
"meta": {
"code": 200
}
}
Unsubscribe from a Channel. This removes it from your Channel stream.
This endpoint responds to general Channel parameters.
Method | URL | Token | Scope |
---|---|---|---|
DELETE | https://alpha-api.app.net/stream/0/channels/{channel_id}/subscribe | User |
public_messages or messages
|
Name | Description |
---|---|
channel_id |
The id of the Channel to unsubscribe from. |
curl -X DELETE -H "Authorization: Bearer <YOUR ACCESS TOKEN>" -H "X-ADN-Pretty-JSON: 1" \
"https://alpha-api.app.net/stream/0/channels/1/subscribe"
{
"data": {
"counts": {
"messages": 42,
"subscribers": 42
},
"has_unread": false,
"id": "1",
"owner": "...user object...",
"is_inactive": false,
"readers": {
"any_user": false,
"immutable": false,
"public": true,
"user_ids": [
],
"you": true
},
"editors": {
"any_user": false,
"immutable": false,
"public": false,
"user_ids": [
],
"you": true
},
"recent_message_id": "231",
"recent_message": "...message object...",
"type": "com.example.channel",
"writers": {
"any_user": false,
"immutable": false,
"public": false,
"user_ids": [
],
"you": true
},
"you_can_edit": true,
"you_subscribed": false,
"you_muted": false
},
"meta": {
"code": 200
}
}
Retrieve the users who are subscribed to a Channel.
This endpoint responds to general Channel parameters.
Responses from this endpoint are paginated.
Method | URL | Token | Scope |
---|---|---|---|
GET | https://alpha-api.app.net/stream/0/channels/{channel_id}/subscribers | Any |
public_messages or messages
|
Name | Description |
---|---|
channel_id |
The id of the Channel to retrieve subscribers for. |
curl -H "Authorization: Bearer <YOUR ACCESS TOKEN>" -H "X-ADN-Pretty-JSON: 1" \
"https://alpha-api.app.net/stream/0/channels/1/subscribers"
{
"data": [
{
"counts": {
"messages": 42,
"subscribers": 43
},
"has_unread": false,
"id": "1",
"owner": "...user object...",
"is_inactive": false,
"readers": {
"any_user": false,
"immutable": false,
"public": true,
"user_ids": [
],
"you": true
},
"editors": {
"any_user": false,
"immutable": false,
"public": false,
"user_ids": [
],
"you": true
},
"recent_message_id": "231",
"recent_message": "...message object...",
"type": "com.example.channel",
"writers": {
"any_user": false,
"immutable": false,
"public": false,
"user_ids": [
],
"you": true
},
"you_can_edit": true,
"you_subscribed": true,
"you_muted": false,
"pagination_id": "82"
}
],
"meta": {
"code": 200,
"more": true,
"min_id": "82",
"max_id": "82"
}
}
Retrieve all the user ids who are subscribed to a Channel.
Method | URL | Token | Scope |
---|---|---|---|
GET | https://alpha-api.app.net/stream/0/channels/{channel_id}/subscribers/ids | Any |
public_messages or messages
|
Name | Description |
---|---|
channel_id |
The id of the Channel to retrieve subscriber ids for. |
curl -H "Authorization: Bearer <YOUR ACCESS TOKEN>" -H "X-ADN-Pretty-JSON: 1" \
"https://alpha-api.app.net/stream/0/channels/1/subscribers/ids"
{
"data": [
"1"
],
"meta": {
"code": 200
}
}
For each requested Channel, retrieve the ids of all Users who are subscribed to that Channel. Up to 200 Channels may be requested at one time. Channels which do not exist or which the requesting user does not have authorization to view will not be returned.
Method | URL | Token | Scope |
---|---|---|---|
GET | https://alpha-api.app.net/stream/0/channels/subscribers/ids | Any |
public_messages or messages
|
Name | Description |
---|---|
ids |
A comma separated list of Channel ids to retrieve subscriber ids for. |
Channels 3 and 5 are omitted as if they are not visible or do not exist
curl -H "Authorization: Bearer <YOUR ACCESS TOKEN>" -H "X-ADN-Pretty-JSON: 1" \
"https://alpha-api.app.net/stream/0/channels/1/subscribers/ids?ids=1,2,3,5"
{
"data": {
"1": [
"5",
"10"
],
"2": [
"5",
"20"
]
},
"meta": {
"code": 200
}
}