Skip to content

Latest commit

 

History

History
379 lines (302 loc) · 11 KB

BlacklistApi.md

File metadata and controls

379 lines (302 loc) · 11 KB

com.Messente.Api.Api.BlacklistApi

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

Method HTTP request Description
AddToBlacklist POST /phonebook/blacklist Adds a phone number to the blacklist
DeleteFromBlacklist DELETE /phonebook/blacklist/{phone} Deletes a phone number from the blacklist
FetchBlacklist GET /phonebook/blacklist Returns all blacklisted phone numbers
IsBlacklisted GET /phonebook/blacklist/{phone} Checks if a phone number is blacklisted

AddToBlacklist

void AddToBlacklist (NumberToBlacklist numberToBlacklist)

Adds a phone number to the blacklist

Example

using System.Collections.Generic;
using System.Diagnostics;
using com.Messente.Api.Api;
using com.Messente.Api.Client;
using com.Messente.Api.Model;

namespace Example
{
    public class AddToBlacklistExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://api.messente.com/v1";
            // Configure HTTP basic authorization: basicAuth
            config.Username = "YOUR_USERNAME";
            config.Password = "YOUR_PASSWORD";

            var apiInstance = new BlacklistApi(config);
            var numberToBlacklist = new NumberToBlacklist(); // NumberToBlacklist | Phone number to be blacklisted

            try
            {
                // Adds a phone number to the blacklist
                apiInstance.AddToBlacklist(numberToBlacklist);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling BlacklistApi.AddToBlacklist: " + e.Message);
                Debug.Print("Status Code: " + e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Using the AddToBlacklistWithHttpInfo variant

This returns an ApiResponse object which contains the response data, status code and headers.

try
{
    // Adds a phone number to the blacklist
    apiInstance.AddToBlacklistWithHttpInfo(numberToBlacklist);
}
catch (ApiException e)
{
    Debug.Print("Exception when calling BlacklistApi.AddToBlacklistWithHttpInfo: " + e.Message);
    Debug.Print("Status Code: " + e.ErrorCode);
    Debug.Print(e.StackTrace);
}

Parameters

Name Type Description Notes
numberToBlacklist NumberToBlacklist Phone number to be blacklisted

Return type

void (empty response body)

Authorization

basicAuth

HTTP request headers

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

HTTP response details

Status code Description Response headers
204 Phone number added to the blacklist -
400 Invalid phone number provided -
401 Unauthorized -
409 Phone number already blacklisted -
0 General error -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

DeleteFromBlacklist

void DeleteFromBlacklist (string phone)

Deletes a phone number from the blacklist

Example

using System.Collections.Generic;
using System.Diagnostics;
using com.Messente.Api.Api;
using com.Messente.Api.Client;
using com.Messente.Api.Model;

namespace Example
{
    public class DeleteFromBlacklistExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://api.messente.com/v1";
            // Configure HTTP basic authorization: basicAuth
            config.Username = "YOUR_USERNAME";
            config.Password = "YOUR_PASSWORD";

            var apiInstance = new BlacklistApi(config);
            var phone = +37251000000;  // string | A phone number

            try
            {
                // Deletes a phone number from the blacklist
                apiInstance.DeleteFromBlacklist(phone);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling BlacklistApi.DeleteFromBlacklist: " + e.Message);
                Debug.Print("Status Code: " + e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Using the DeleteFromBlacklistWithHttpInfo variant

This returns an ApiResponse object which contains the response data, status code and headers.

try
{
    // Deletes a phone number from the blacklist
    apiInstance.DeleteFromBlacklistWithHttpInfo(phone);
}
catch (ApiException e)
{
    Debug.Print("Exception when calling BlacklistApi.DeleteFromBlacklistWithHttpInfo: " + e.Message);
    Debug.Print("Status Code: " + e.ErrorCode);
    Debug.Print(e.StackTrace);
}

Parameters

Name Type Description Notes
phone string A phone number

Return type

void (empty response body)

Authorization

basicAuth

HTTP request headers

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

HTTP response details

Status code Description Response headers
204 Phone number deleted from the blacklist -
400 Invalid phone number provided -
401 Unauthorized -
404 Phone number is not in the blacklist -
0 General error -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

FetchBlacklist

FetchBlacklistSuccess FetchBlacklist ()

Returns all blacklisted phone numbers

Example

using System.Collections.Generic;
using System.Diagnostics;
using com.Messente.Api.Api;
using com.Messente.Api.Client;
using com.Messente.Api.Model;

namespace Example
{
    public class FetchBlacklistExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://api.messente.com/v1";
            // Configure HTTP basic authorization: basicAuth
            config.Username = "YOUR_USERNAME";
            config.Password = "YOUR_PASSWORD";

            var apiInstance = new BlacklistApi(config);

            try
            {
                // Returns all blacklisted phone numbers
                FetchBlacklistSuccess result = apiInstance.FetchBlacklist();
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling BlacklistApi.FetchBlacklist: " + e.Message);
                Debug.Print("Status Code: " + e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Using the FetchBlacklistWithHttpInfo variant

This returns an ApiResponse object which contains the response data, status code and headers.

try
{
    // Returns all blacklisted phone numbers
    ApiResponse<FetchBlacklistSuccess> response = apiInstance.FetchBlacklistWithHttpInfo();
    Debug.Write("Status Code: " + response.StatusCode);
    Debug.Write("Response Headers: " + response.Headers);
    Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
    Debug.Print("Exception when calling BlacklistApi.FetchBlacklistWithHttpInfo: " + e.Message);
    Debug.Print("Status Code: " + e.ErrorCode);
    Debug.Print(e.StackTrace);
}

Parameters

This endpoint does not need any parameter.

Return type

FetchBlacklistSuccess

Authorization

basicAuth

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 An object containing a list of blacklisted phone numbers -
401 Unauthorized -
0 General error -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

IsBlacklisted

void IsBlacklisted (string phone)

Checks if a phone number is blacklisted

Example

using System.Collections.Generic;
using System.Diagnostics;
using com.Messente.Api.Api;
using com.Messente.Api.Client;
using com.Messente.Api.Model;

namespace Example
{
    public class IsBlacklistedExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://api.messente.com/v1";
            // Configure HTTP basic authorization: basicAuth
            config.Username = "YOUR_USERNAME";
            config.Password = "YOUR_PASSWORD";

            var apiInstance = new BlacklistApi(config);
            var phone = +37251000000;  // string | A phone number

            try
            {
                // Checks if a phone number is blacklisted
                apiInstance.IsBlacklisted(phone);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling BlacklistApi.IsBlacklisted: " + e.Message);
                Debug.Print("Status Code: " + e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Using the IsBlacklistedWithHttpInfo variant

This returns an ApiResponse object which contains the response data, status code and headers.

try
{
    // Checks if a phone number is blacklisted
    apiInstance.IsBlacklistedWithHttpInfo(phone);
}
catch (ApiException e)
{
    Debug.Print("Exception when calling BlacklistApi.IsBlacklistedWithHttpInfo: " + e.Message);
    Debug.Print("Status Code: " + e.ErrorCode);
    Debug.Print(e.StackTrace);
}

Parameters

Name Type Description Notes
phone string A phone number

Return type

void (empty response body)

Authorization

basicAuth

HTTP request headers

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

HTTP response details

Status code Description Response headers
204 Phone number is in the blacklist -
400 Invalid phone number provided -
401 Unauthorized -
404 Phone number is not in the blacklist -

[Back to top] [Back to API list] [Back to Model list] [Back to README]