Set your default language: PHP | Curl

GET users/:id/listening

Used for retrieving a list of users a given user is listening to. Does not return fully expanded user objects, rather a simple list of user ID's. To get expanded user information, see the 'users/lookup' endpoint and pass it the result set.

Details

URL https://api.heello.com/users/:id/listening.format
Requires Authentication No
Rate Limited Yes
Response Formats json

Parameters

Parameter Required Notes
:id The user ID or username of the user to get a list of listeners for. Include this ID in the URL of the request.
key The application ID for the application making the request.
username Force the :id parameter to refer to a username instead of a user ID. Possible values are 1 or 0.
count The number of results to return.

Maximum is 5000, default is 20.
start Starting position for paging. If you get 20 results, set start=21 to get the next 20 results (assuming count is 20).

Errors

There are no unique error states for this endpoint, please see our page detailing general errors you may encounter.

Example Usage

GET https://api.heello.com/users/:id/listening.json
curl https://api.heello.com/users/1/listening.json?key=APPLICATION_KEY
// Note: PHP Examples use the Heello PHP Client library
// https://github.com/Heello/heello-php
require_once dirname(dirname(dirname(__FILE__))) . '/Heello.php';

// You can get an Application Key and Secret by visiting:
// http://developer.heello.com/apps
$api_application_key = "APPLICATION_KEY";
$api_application_secret = "APPLICATION_SECRET";

$api = new Heello\Client($api_application_key, $api_application_secret);

try{
  // Get an array of Heello user ids, use a username lookup instead of the id of the user
  $users = $api->users->listening(array(
    "id" => "heello",
    "count" => 10,
    "username" => 1
  ));

  // Note that $users isn't an array of user objects, to get a list of user objects
  // use the user lookup api endpoint. ids takes a comma separated list of user ids
  $users = $api->users->lookup(array(
    "ids" => implode(",",$users)
  ));

  print_r($users);
} catch (Exception $e){
  print $e->getMessage();
}
Please use the "Live Demo" below to see an example response.
You may need to login or create an account before making requests against the API.

Live Demo

Please login and create an application to perform live API testing.