Skip to content
Petr edited this page Jun 20, 2018 · 34 revisions

Any Generic Request

{
  "id": 0, // required
  "action": "XXX" // required
}

INIT

Request

{
  "session_id": "XXX" // optional
}

Response

{
  "session_id": "XXX",
  "connection_id": "XXX",
  "expires_in": 172800
}

AUTH

After login button has been pressed and client pressed start in bot

Response

{
  "user_id": 123456789,
  "first_name": "XXX",
  "username": "XXX",
  "language_code": "XXX",
  "photo": "XXX"
}

FETCH_CHANNELS

Request

{
  "count": 0, // optional
  "offset": 0, // optional
  "title": "XXX", // optional
  "category": "XXX", // optional
  "members": [0, 0], // optional, must be of .length === 2
  "cost": [0, 0] // optional, must of .length === 2
}

Response

{
  "data": {
    "items": [], // array of channels
    "categories": [
      {
        "category": "XXX",
        "count": 0
      }
    ],
    "total": 0,
    "max_members": 0,
    "max_cost": 0
  }
}

FETCH_CHANNEL

Request

{
  "username": "XXX" // required
}

Response

{
  "id": 0,
  "action": "FETCH_CHANNELS",
  "data": {
    "channel": {}
  }
}

Clone this wiki locally