Using the Coub web API you can manage a channel: create it, edit or delete.
Getting a channel's data
Resource endpoint:
GET /api/v2/channels/:id
- id (integer) — the id or the permalink of the required channel.
Response format:
Request example
GET /api/v2/channels/55
Create a channel
Resource endpoint:
POST /api/v2/channels
Request parameters:
- channel[title] (string) — the title of the channel;
- channel[permalink] (string) — the permalink of the channel;
- channel[category] (string) — the channel's category.
Request example:
POST /api/v2/channels?channel[title]=My bussiness channel&channel[permalink]=mybussiness&channel[category]=business
Response format:
The JSON with status
filed.
Response example:
{
"status": "ok"
}
Update channel data
You can update channel's settings by sending its identifier and new data as parameters of the PUT request.
Resource endpoint:
PUT /api/v2/channels/update_info
Request parameters:
- id (integer) — the identifier of the channel;
- channel[title] (string) — the title of the channel;
- channel[description] (string) — the channel's description text;
- channel[category] (string) — the channel's category.
- channel[permalink] (string) — the permalink of the channel;
- channel[password]] (string) — the channel's password, should be send only when permalink's change is required;
- channel[autopost_coub_to_facebook] (boolean) — whether the channel should automatically post coubs to the user facebook account;
- channel[autopost_recoub_to_facebook] (boolean) — whether the channel should automatically post recoubs to the user's facebook account;
- channel[autopost_coub_to_vkontakte] (boolean) — whether the channel should automatically post coubs to the user's vk account;
- channel[autopost_recoub_to_vkontakte] (boolean) — whether the channel should automatically post recoubs to the user's vk account;
- channel[autopost_coub_to_twitter] (boolean) — whether the channel should automatically post coubs to the user's twitter account;
- channel[autopost_recoub_to_twitter] (boolean) — whether the channel should automatically post recoubs to the user's twitter account;
- channel[homepage] (string) — the URL to the channel's homepage in the web;
- channel[tumblr] (string) — the channel's tumblr account name;
- channel[youtube]:asdasd (string) — the channel's youtube account name;
- channel[vimeo] (string) — the channel's vimeo account name.
Request example:
PUT /api/v2/channels/update_info?id=525&channel[title]=new title&channel[category]=new category&channel[autopost_coub_to_twitter]=true
Response parameters:
Delete a channel
Resource endpoint:
DELETE /api/v2/channels/:id
- id (integer) — the identifier of the channel.
Request parameters:
- password (string) — the channel's password.
Request example:
DELETE /api/v2/channels/452?password=mypassword
Response format:
The JSON with status
filed.
Response example:
{
"status": "ok"
}
Change a channel avatar
Resource endpoint:
POST /api/v2/channels/upload_avatar
Request parameters:
- id (channel[id]) — the identifier of the channel;
- channel[avatar] (base64) — the file with the new avatar image encoded in base64 format.
Response parameters:
Delete a channel avatar
Resource endpoint:
DELETE /api/v2/channels/upload_avatar
Request parameters:
- id (channel[id]) — the identifier of the channel.
Response format: