Set your default language: PHP | Curl

POST users/:id/block

Make the authenticated user block another user


Requires Authentication Yes
Rate Limited Yes
Response Formats json


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


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

// Note: PHP Examples use the Heello PHP Client library
require_once dirname(dirname(dirname(__FILE__))) . '/Heello.php';

// You can get an Application Key and Secret by visiting:
$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):
$access_token = "ACCESS_TOKEN";

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

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

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.