Lookup

Retrieve a Channel

Returns a specific Channel.

This endpoint responds to general Channel parameters.

Endpoint

Method URL Token Scope
GET https://api.app.net/channels/{channel_id} Any public_messages or messages

URL Parameters

Name Description
channel_id The id of the Channel to retrieve.

Example

to see more complete examples.

curl -H "Authorization: Bearer <YOUR ACCESS TOKEN>" -H "X-ADN-Pretty-JSON: 1" \
    "https://api.app.net/channels/1"
{
  "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
  }
}

Retrieve multiple Channels

Returns multiple Channels requested by id. At most 200 channels can be requested. Channels which do not exist or which the requesting user does not have authorization to view will not be returned.

This endpoint responds to general Channel parameters.

Endpoint

Method URL Token
GET https://api.app.net/channels Any

Query String Parameters

Name Description
ids A comma separated list of ids of Channels to retrieve.

Example

In the following example, Channel 6502 is omitted because it doesn’t exist or we don’t have permission to view it.

to see more complete examples.

curl -H "Authorization: Bearer <YOUR ACCESS TOKEN>" -H "X-ADN-Pretty-JSON: 1" \
    "https://api.app.net/channels?ids=1,2,6502"
{
  "data": [
    {
      "counts": {
        "messages": 42,
        "subscribers": 43
      },
      "has_unread": false,
      "id": "2",
      "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
    },
    {
      "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
  }
}

Retrieve my Channels

Returns a stream of all Channels the current user has created.

This endpoint responds to general Channel parameters.

Responses from this endpoint are paginated.

Endpoint

Method URL Token Scope
GET https://api.app.net/users/me/channels User public_messages or messages

Example

to see more complete examples.

curl -H "Authorization: Bearer <YOUR ACCESS TOKEN>" -H "X-ADN-Pretty-JSON: 1" \
    "https://api.app.net/users/me/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": "1"
    }
  ],
  "meta": {
    "code": 200,
    "more": false,
    "min_id": "1",
    "max_id": "1"
  }
}

Retrieve number of unread PM Channels

Returns the current number of net.app.core.pm Channels where has_unread: true for the current user.

Endpoint

Method URL Token Scope
GET https://api.app.net/users/me/channels/pm/num_unread User messages

Example

to see more complete examples.

curl -H "Authorization: Bearer <YOUR ACCESS TOKEN>" -H "X-ADN-Pretty-JSON: 1" \
    "https://api.app.net/users/me/channels/pm/num_unread"
{
  "data": 5,
  "meta": {
    "code": 200
  }
}

Retrieve number of unread Broadcast Channels

Returns the current number of net.app.core.broadcast Channels where has_unread: true for the current user.

Endpoint

Method URL Token Scope
GET https://api.app.net/users/me/channels/broadcast/num_unread User messages

Example

to see more complete examples.

curl -H "Authorization: Bearer <YOUR ACCESS TOKEN>" -H "X-ADN-Pretty-JSON: 1" \
    "https://api.app.net/users/me/channels/broadcast/num_unread"
{
  "data": 3,
  "meta": {
    "code": 200
  }
}

Mark all Broadcast Channels as read

Mark all net.app.core.broadcast Channels as read for the current user.

Endpoint

Method URL Token Scope
DELETE https://api.app.net/users/me/channels/broadcast/num_unread User messages

Example

to see more complete examples.

curl -X DELETE -H "Authorization: Bearer <YOUR ACCESS TOKEN>" -H "X-ADN-Pretty-JSON: 1" \
    "https://api.app.net/users/me/channels/broadcast/num_unread"
{
  "data": 0,
  "meta": {
    "code": 200
  }
}