Description

Y8 provides API requests to retrieve a list of a user’s friends to display in your application.

Getting friends list

Request

GET: "https://account.y8.com/api/v1/json/[user-id]/friends"

or

GET: "https://account.y8.com/api/v1/json/[user-id]/friends?limit=[limit]&offset=[offset]"

Accepts following attributes:

Attribute Requirement Default value Description
id Required Unique identifier for user in your application
offset Optional 0 Offset to start from
limit Optional 20 Number of users per page. Can't be more then 100.

Response

Response will have a list of friends nicknames, paths to avatars and ids in “data” array and a special object for pagination, that will have links to next and previous (if available) pages.

The id parameter in each Object of the data Array is the corresponding PID of the user

Note that link to next page will be always present, even if there are no more friends to show.

Example Request

GET /api/v1/json/5257eb9aa80315f627000006/friends?limit=2&offset=4
Authorization: Bearer c95f1d3ce3d4f077e4968e1a7976c9fa0fd5f90db703682c4ed29a308f58e99c

Example Response

{
  "data": [
    {
      "id": "0000000001",
      "nickname": "Nettor",
      "avatars": {
        "thumb_url": "http://cdn.y8.com/assets/avatar-b66da0b9dc887c02c1919c6538680131_thumb.png",
        "thumb_secure_url": "https://scdn.y8.com/assets/avatar-b66da0b9dc887c02c1919c6538680131_thumb.png",
        "medium_url": "http://cdn.y8.com/assets/avatar-b66da0b9dc887c02c1919c6538680131_medium.png",
        "medium_secure_url": "https://scdn.y8.com/assets/avatar-b66da0b9dc887c02c1919c6538680131_medium.png",
        "large_url": "http://cdn.y8.com/assets/avatar-b66da0b9dc887c02c1919c6538680131_large.png",
        "large_secure_url": "https://scdn.y8.com/assets/avatar-b66da0b9dc887c02c1919c6538680131_large.png",
      }
    },
    {
      "id": "0000000042",
      "nickname": "L337_n00b",
      "avatars": {
        "thumb_url": "http://cdn.y8.com/assets/avatar-01ba8a10fda_thumb.png",
        "thumb_secure_url": "https://scdn.y8.com/assets/avatar-01ba8a10fda_thumb.png",
        "medium_url": "http://cdn.y8.com/assets/avatar-01ba8a10fda_medium.png",
        "medium_secure_url": "https://scdn.y8.com/assets/avatar-01ba8a10fda_medium.png",
        "large_url": "http://cdn.y8.com/assets/avatar-01ba8a10fda_large.png",
        "large_secure_url": "https://scdn.y8.com/assets/avatar-01ba8a10fda_large.png",
      }
    }
  ],
  "paging": {
    "previous": "https://account.y8.com/api/v1/json/5257eb9aa80315f627000006/friends?limit=2&offset=2",
    "next": "https://account.y8.com/api/v1/json/5257eb9aa80315f627000006/friends?limit=2&offset=6"
  }
}

We have a request for getting only person’s followers. It works exacly the same as friends, but “friends” should be replaced by “followers” in all according routes.