UserBlocksManager

management. UserBlocksManager

Abstracts interaction with the user-blocks endpoint.

Constructor

new UserBlocksManager(options)

Source:
Parameters:
Name Type Description
options Object

The client options.

Name Type Attributes Description
baseUrl String

The URL of the API.

headers Object <optional>

Headers to be included in all requests.

retry Object <optional>

Retry Policy Config

Methods

delete(params, cbopt) → {Promise|undefined}

Unblock an user by its id.

Source:
Parameters:
Name Type Attributes Description
params Object

The user data object..

Name Type Description
id String

The user id.

cb function <optional>

Callback function

Returns:
Type:
Promise | undefined
Example
management.userBlocks.delete({ id: USER_ID }, function (err) {
  if (err) {
    // Handle error.
  }

  // User unblocked.
});

deleteByIdentifier(params, cbopt) → {Promise|undefined}

Unblock an user by identifier.

Source:
Parameters:
Name Type Attributes Description
params Object

The user data object..

Name Type Description
identifier String

The user identifier, any of: username, phone_number, email.

cb function <optional>

Callback function

Returns:
Type:
Promise | undefined
Example
management.userBlocks.deleteByIdentifier({ identifier: USER_ID }, function (err) {
  if (err) {
    // Handle error.
  }

  // User unblocked.
});

get(params, cbopt) → {Promise|undefined}

Get user blocks by id.

Source:
Parameters:
Name Type Attributes Description
params Object

The user data object..

Name Type Description
id String

The user id.

cb function <optional>

Callback function

Returns:
Type:
Promise | undefined
Example
management.userBlocks.get({ id: USER_ID }, function (err, blocks) {
  if (err) {
    // Handle error.
  }

  console.log(blocks);
});

getByIdentifier(params, cbopt) → {Promise|undefined}

Get user blocks by identifier.

Source:
Parameters:
Name Type Attributes Description
params Object

The user data object..

Name Type Description
identifier String

The user identifier, any of: username, phone_number, email.

cb function <optional>

Callback function

Returns:
Type:
Promise | undefined
Example
management.userBlocks.getByIdentifier({ identifier: USER_ID }, function (err, blocks) {
  if (err) {
    // Handle error.
  }

  console.log(blocks);
});