Set your default language: PHP | Curl

POST users/:id/block

Make the authenticated user block another user

Details

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

Parameters

Parameter Required Notes
access_token Access token of authenticated user. This is the token of the user who will be blocking user specified by the :id parameter.
:id ID for the user to block.
username Provide the 'username' param if the :id used in the API call is a username rather than a user id

Errors

In addition to the general errors documented, the following special errors may also be applicable:
Error Code Notes
400 If the user ID to block is the same as the authenticated user.

Example Usage

POST https://api.heello.com/users/2/block.json
// 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";

// You can get an access token and refresh token by implementing the auth
// flow described at (or use the demo provided):
// http://developer.heello.com/guides/authentication
$access_token = "ACCESS_TOKEN";

$api = new Heello\Client($api_application_key, $api_application_secret);
Heello\Client::config()->set_access_token($access_token);

try{
  // Response is user object of user listened to
  $response = $api->users->listen(array(
    "id" => 1
  ));

  print_r($response);
}
catch (Exception $e){
  print $e->getMessage();
}
On a successul request, a '201 Created' response is sent
with a user object for the user being blocked to.

See endpoint documentation for users/show for details.

Live Demo

Live demo is not currently supported for this endpoint.