Search

Search for Channels

Returns Channel objects which match a given search query. Because channels have no inherent notion of description or name, we take textual data from common channel annotations which contain such fields, e.g. net.patter-app.settings. We also allow filtering on specific channel properties, such as channel type. No matter what query data is supplied, the search results will respect channel ACLs, and results are limited to non-private channels if the requesting access token does not have the messages scope.

Separate lists of terms by spaces.

This endpoint responds to general Channel parameters.

Endpoint

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

General Parameters

Name Required? Type Description
order Optional string One of: popularity (default), id, or activity. Searches of ordering popularity are returned in an order that roughly matches the popularity of the channels. activity searches will order results roughly by time of last message (precise sorting of very recent messages is not guaranteed).

Search Query Parameters

Name Required? Type Description
q Optional string Searches any textual fields extracted from channel annotations. We may tweak which annotations and fields are included by this search over time.

Filter Parameters

Name Required? Type Description
type Optional string Only include channels which were created with a specific channel type
creator_id Optional string Only include channels which were created by a user with a certain id
tags Optional string Only include channels which are tagged with certain tags. This data is extracted from channel annotations
is_private Optional boolean Only include channels which have any_user and public set to false for read and write ACLs
is_public Optional boolean Only include channels which have public set to true for read ACLs

Example

to see more complete examples.

curl -H "Authorization: Bearer <YOUR ACCESS TOKEN>" -H "X-ADN-Pretty-JSON: 1" \
    "https://api.app.net/channels/search?q=kerbal&order=popularity"
{
  "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": "10000"
    }
  ],
  "meta": {
    "code": 200,
    "more": false,
    "count": 1,
    "min_id": "10000",
    "max_id": "10000"
  }
}