News! SmartSender.io becomes Wooxy. Read a post from the CEO Arrow
Wooxy API v.3.0

Find Contact In Viber Black List

The Find Contact In Viber Black List method allows you to find one or more phone numbers on the Viber blacklist.

Important! In this method, pagination is used to display information about a large number of lists simultaneously. The offset is considered the starting point, and the limit is the endpoint.

Request

POST
/v3/viber/blacklist/find

IMPORTANT: Do not send more than 10 concurrent API requests.

Body Example

                                        {
    "phoneNumber": "+1555555",
    "rejectType": "spam",
    "source": "api",
    "offset": 0,
    "limit": 10
}
                                    

Parameters

Title Type Default Description

phoneNumber

required
string

IMPORTANT: should be valid E.164 phone number.

rejectType

optional
string

One of the available reasons for placing the phone number on the Viber Black List:

  • Spam: Used to indicate that the user complained or asked to unsubscribe;
  • Invalid: Used to indicate that the phone number is invalid or non-existent.

source

optional
string

Source for adding a contact to the Viber Black List:

  • api: Used to indicate that the phone number was added the the suppression list via API;
  • manual: Used to indicate that the phone number was added the the suppression list manually via the admin panel;
  • import: Used to indicate that the phone number was added the the suppression list via import file.

offset

optional
integer 0

Integer shift. Default value: 0.

limit

optional
integer 20

Integer limit. Default value: 20.

Response

                                        {
 "result":true,
 "data":[
  {
   "phoneNumber":"+15555555",
   "rejectType":"spam",
   "source": "api",
   "createdAt":"YYYY-MM-DD h:i:s"
  }
 ],
 "totalCount":1,
 "offset":0,
 "limit":10
}
                                    

Parameters

Title Type Description

result

boolean

The value indicates that the request was successful and contact information was fetched from the account Viber Black List:

  • true: The request was successful.

data

array

Array of objects. Each object contains information on record regarding the requested contact in account Viber Black List.

data.phoneNumber

string

Requested phone number.

data.rejectType

string

One of the available reasons for placing the phone number in the Viber Black List:

  • spam: Used to indicate that the user complained or asked to unsubscribe;
  • invalid: Used to indicate that phone number is invalid or non-existing.

data.createdAt

string

Date when the requested contact was added to the Viber Black List. Date format: YYYY-MM-DD h:i:s.

totalCount

integer

Total number of contact records in account Viber Black List.

offset

integer

Provided integer shift.

limit

integer

Provided integer limit.

Method Errors

                                        {
   "result":false,
   "errors":[
      "Error description text"
   ]
}
                                    
Error

“Argument phoneNumber must be a non-empty string”

“Allowed reject types are {allowed}, but {rejectType} given”

“Parameter offset must have a numeric value”

“Parameter limit must have a numeric value”

“Invalid authorization token!”

“Internal server error”

“Bad Request”

“no matches found for access token {accessToken}”

“user {id} not enabled”

“no data found for key {userId}”

“access token check failed for key\/secret $key\/$accessToken”

“Argument {argument} required”

Code Examples

PHP
                $accessToken = "YOUR_API_KEY";
$url         = 'https://api.wooxy.com/v3/viber/blacklist/find';

$body = json_encode([
    "phoneNumber" => "+1555555",
    "rejectType"  => "import",
    "source" => "api",
    "offset"      => 0,
    "limit"       => 10,
]);

/**
 * Request Example
 */
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
//curl_setopt($ch, CURLOPT_HEADER, true);
curl_setopt($ch, CURLOPT_INFILESIZE, null);
curl_setopt($ch, CURLOPT_POSTFIELDS, $body);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    "Access-Token: $accessToken",
    'Content-Type: application/json',
    'Content-Length: ' . strlen($body),
]);

$result = curl_exec($ch);
if ($result === false) {
    echo 'cURL error:' . curl_error($ch) . PHP_EOL;
} else {
    echo strval($result) . PHP_EOL;
}
curl_close($ch);