Skip to content
This repository has been archived by the owner on Jan 18, 2021. It is now read-only.

Latest commit

 

History

History
204 lines (141 loc) · 4.94 KB

BlacklistApi.md

File metadata and controls

204 lines (141 loc) · 4.94 KB

PhonebookApi.BlacklistApi

All URIs are relative to https://api.messente.com/v1

Method HTTP request Description
addToBlacklist POST /phonebook/blacklist
fetchBlacklist GET /phonebook/blacklist
isBlacklisted GET /phonebook/blacklist/{phone_number}
removeFromBlacklist DELETE /phonebook/blacklist/{phone_number}

addToBlacklist

addToBlacklist(numberToBlacklist)

Adds a phone number to the blacklist.

Example

var PhonebookApi = require('phonebook_api');
var defaultClient = PhonebookApi.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new PhonebookApi.BlacklistApi();
var numberToBlacklist = new PhonebookApi.NumberToBlacklist(); // NumberToBlacklist | Phone number to be blacklisted
var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
apiInstance.addToBlacklist(numberToBlacklist, callback);

Parameters

Name Type Description Notes
numberToBlacklist NumberToBlacklist Phone number to be blacklisted

Return type

null (empty response body)

Authorization

basicAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

fetchBlacklist

FetchBlacklistSuccess fetchBlacklist()

Returns all blacklisted phone numbers.

Example

var PhonebookApi = require('phonebook_api');
var defaultClient = PhonebookApi.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new PhonebookApi.BlacklistApi();
var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.fetchBlacklist(callback);

Parameters

This endpoint does not need any parameter.

Return type

FetchBlacklistSuccess

Authorization

basicAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

isBlacklisted

isBlacklisted(phoneNumber)

Checks if a phone number is blacklisted.

Example

var PhonebookApi = require('phonebook_api');
var defaultClient = PhonebookApi.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new PhonebookApi.BlacklistApi();
var phoneNumber = "phoneNumber_example"; // String | A phone number
var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
apiInstance.isBlacklisted(phoneNumber, callback);

Parameters

Name Type Description Notes
phoneNumber String A phone number

Return type

null (empty response body)

Authorization

basicAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

removeFromBlacklist

removeFromBlacklist(phoneNumber)

Removes a phone number from the blacklist.

Example

var PhonebookApi = require('phonebook_api');
var defaultClient = PhonebookApi.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new PhonebookApi.BlacklistApi();
var phoneNumber = "phoneNumber_example"; // String | A phone number
var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
apiInstance.removeFromBlacklist(phoneNumber, callback);

Parameters

Name Type Description Notes
phoneNumber String A phone number

Return type

null (empty response body)

Authorization

basicAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json