close
The Wayback Machine - https://web.archive.org/web/20140813152849/https://developer.beatsmusic.com/docs/read/follows/Following

Following

Get the list of objects the object is following. Possible values for the relation field are "follows" or "none". Follows indicates a reciprocal relation between the objects and the requester.


PLEASE NOTE:

The relation attribute refers to the relationship between the requester of the resource and the target_id. Not the id and target_id, which is given by either a 200 for present or 404 for not present.

Example:
user 12345 issues the following request:
GET /api/users/67333/follows/99999 -> Does 67333 follow 99999?


If this is true then a 200 will be returned along with the relationship entry. The relation field will indicate whether 12345 is also following 99999.


Endpoint URL

/api/:type/:id/follows


HTTP Method

GET


Authentication

OAuth 2.0: Access token required. See Authentication for examples and details.


Parameters

Name Required Description Example

type

required type of the id

Example:
users, curators, genres
users

id

required ID of the user, curator, genre 12345

filters

optional Array of filter operations to apply. Each operation is filter:value.

Valid filters: type:artist, type:curator, type:genre, type:user

Example:
filters=type:artist&filters=type:curator

offset

optional Integer offset into results, 0 based. Defaults to 0. 0

limit

optional Specifies the maximum number of records to retrieve. You are guaranteed to get at most this number of results, but you may get fewer. If set to zero or less, returns nothing. Maximum value is 200 (i.e., if greater than 200, returns only 200). If not supplied, defaults to 20. 20

order_by

optional Indicates how the results set should be ordered.

Response Elements

ResponseDescription
code

Beats API response code. If successful, code is 'OK'. Otherwise it will be an error code.

info

container for paging information

offset

Integer offset into results, 0 based. Always matches supplied argument value.

count

Number of results returned for this request.

total

Total number of elements available for this resource.


Example Response

{
    "code": "OK",
    "info": {
        "count": 4,
        "total": 4,
        "offset": 0
    },
    "data": [
        {
            "type": "relationship",
            "relation": "follows",
            "object": {
                "type": "user",
                "id": "N3QnTIN2TDM",
                "full_name": "Ted Heffner",
                "country": "US",
                "username": "teddy",
                "total_followed_by": "string",
                "total_follows": "string"
            }
        },
        {
            "type": "relationship",
            "relation": "none",
            "object": {
                "type": "user",
                "id": "sjdfhjsfjds",
                "full_name": "Jane Cleveland",
                "country": "US",
                "username": "janekins"
            }
        }
    ]
}

Docs Navigation