Users

You can obtain your user data and manage your user channels using users endpoint.

Changing current active channel

The current active channel is set when you like or recoub something without setting specified channel_id. Don't forget to change it when needed.

Resource endpoint:

PUT /api/v2/users/change_channel

Request parameters:

  • id (integer) — the id of the required channel.

Request example:

PUT /api/v2/users/change_channel?channel_id=123123

Response format:

The Coub server responses to a request with the JSON, contains following fields:

  • id (integer) — the identifier of the user;
  • permalink (string) — the permalink of the user;
  • name (string) — the name of the user;
  • sex (string) — the gender of the user, can be set to one of the following values: male, female, unspecified;
  • city (string) — the city that the user specified in the profile;
  • current_channel (JSON) — the channel small JSON relates to the channel that currently used by the user;
  • created_at (UNIX-time) — the time when the user profile was created;
  • updated_at (UNIX-time) — the time of the user profile's last update;
  • api_token (string) — the current access token.

Response example

{
    id: 1122,
    permalink: "a62edaf53184ef63223da7bbbf188581",
    name: "username",
    sex: "female",
    city: null,
    current_channel: channel small JSON,
    created_at: "2014-10-07T18:17:28Z",
    updated_at: "2015-01-14T15:35:17Z",
    api_token: "de57ff1353bec07b25e6d75165b13de5f539993f61ce240f6c1a622dd07edb69c6471824sd2c127de16b0a5b1d62c8a13770474965deb652afba7f46c7944565"
}

Getting your user data

Resource endpoint:

GET /api/v2/users/me

Request parameters:

None.

Response format:

The Coub server responses to a request with the JSON that contains following fields:

  • id (integer) — the identifier of the user;
  • permalink (string) — the permalink of the user;
  • name (string) — the name of the user;
  • sex (string) — the gender of the user, can be set to one of the following values: male, female, unspecified.
  • city (string) — the city that the user specified in the profile;
  • current_channel (JSON) — the channel small JSON relates to the channel that currently chosen by the user;
  • created_at (UNIX-time) — the time when the user profile was created;
  • updated_at (UNIX-time) — the time of the user profile's last update;
  • api_token (string) — the current access token.

Response example

{
    id: 1122,
    permalink: "a62edaf53184ef63223da7bbbf188581",
    name: "username",
    sex: "female",
    city: null,
    current_channel: channel small JSON,
    created_at: "2014-10-07T18:17:28Z",
    updated_at: "2015-01-14T15:35:17Z",
    api_token: "de57ff1353bec07b25e6d75165b13de5f539993f61ce240f6c1a622dd07edb69c6471824sd2c127de16b0a5b1d62c8a13770474965deb652afba7f46c7944565"
}