Channel background

The Coub API allows you to change the channel's background image.

Adding a background

Resource endpoint:

POST /api/v2/channels/:channel_id/backgrounds
  • channel_id (integer) — the identifier of the channel.

Request parameters:

  • background[coub] (string) — the permalink of the coub that will be used as a background;
  • background[image] (string) — the image file send as multipart/form-data content type.

Only one parameter should be set for this request: either background[coub] or background[image].

Request example:

POST /api/v2/channels/1234/backgrounds?background[coub]=mycoub

Response parameters:

The JSON with the ok status or with an error message.

Response example:

{
    status: "ok"
}

Changing the background's vertical position

Resource endpoint:

PUT /api/v2/channels/:channel_id/backgrounds
  • channel_id (integer) — the identifier of the channel.

Request parameters:

  • offset_y (float) — the image center's shift in pixels.

Request example:

POST /api/v2/channels/1234/backgrounds&offset_y=208.9108910891089

Response parameters:

The JSON with the ok status or with an error message.

Response example:

{
    status: "ok"
}

Deleting a background

Resource endpoint:

DELETE /api/v2/channels/:channel_id/backgrounds
  • channel_id (integer) — the identifier of the channel.

Request parameters:

None.

Request example:

DELETE /api/v2/channels/1234/backgrounds

Response parameters:

The JSON with the ok status or with an error message.

Response example:

{
    status: "ok"
}