למאגר המידע של מסקיו

Maskyoo API 16

Blacklist Methods related

Add number to blacklist

This function purpose is to allow call recording sound file download (single call).


/api/?service=add_number_to_blacklist

Usage and SDK Samples


	curl -H "Authorization: Bearer < TOKEN_FROM_SYSTEM >" -X get "https://[MASKYOO_URL]/api/?service=add_number_to_blacklist&caller_number=&format="
	

using System.Net;
using System.Collections.Specialized;
namespace Examples.System.Net
{
    public class WebRequestPostExample
    {
        public static void Main ()
        {
			string url_query_string="https://[MASKYOO_URL]/api/?";
			using (var client = new WebClient())
			{
				var values = new NameValueCollection();
				values["service"] = "add_number_to_blacklist";
				values["caller_number"] = "654654";
				values["note"] = "test";
				values["format"] = "json";

				client.Headers.Add("Authorization","Bearer < TOKEN_FROM_SYSTEM >");
                var response = client.UploadValues(url_query_string, values);

				var responseString = Encoding.Default.GetString(response);
				Console.WriteLine (responseString);
			}
        }
    }
}

	

<?php
	$base_url="https://[MASKYOO_URL]/api/";
	$data = array(
		"service" => "add_number_to_blacklist",                 
		"caller_number" => "654654",        			
		"note" => "test",
		"format" => "json"      
	);
	echo post_data($base_url, $data);

	function post_data($url, $data){
		$fields = '';
		foreach($data as $key => $value) { 
			$fields .= $key . '=' . $value . '&'; 
		}
		rtrim($fields, '&');
		$post = curl_init();
		curl_setopt($post, CURLOPT_URL, $url);
		curl_setopt($post, CURLOPT_POST, count($data));
		curl_setopt($post, CURLOPT_POSTFIELDS, $fields);
		curl_setopt($post, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($post, CURLOPT_HTTPHEADER, array("Authorization: Bearer < TOKEN_FROM_SYSTEM >"));
		$result = curl_exec($post);
		curl_close($post);
		return $result; 
	}
?>
	

Parameters

Query parameters
Name Description
caller_number*
note
format

Responses

Status: 200 - Success response

Status: 2021 - error the caller_number have to be numeric and can't be empty

Status: 2022 - error the number already exist in blacklist

Status: 2023 - error the number didnt insert into blacklist


Get blacklist

This function purpose is to create a System querying on phone numbers and/or specific prefixes that were blocked for calling maskyoo numbers within the system.


/api/?service=get_blacklist

Usage and SDK Samples


	curl -H "Authorization: Bearer < TOKEN_FROM_SYSTEM >" -X get "https://[MASKYOO_URL]/api/?service=get_blacklist&caller_number=&format="
	

using System.Net;
using System.Collections.Specialized;
namespace Examples.System.Net
{
    public class WebRequestPostExample
    {
        public static void Main ()
        {
			string url_query_string="https://[MASKYOO_URL]/api/?";
			using (var client = new WebClient())
			{
				var values = new NameValueCollection();
				values["service"] = "get_blacklist";
				values["caller_number"] = "1234";
				values["format"] = "json";

				client.Headers.Add("Authorization","Bearer < TOKEN_FROM_SYSTEM >");
                var response = client.UploadValues(url_query_string, values);

				var responseString = Encoding.Default.GetString(response);
				Console.WriteLine (responseString);
			}
        }
    }
}
	

<?php
	$base_url="https://[MASKYOO_URL]/api/";
	$data = array(
		"service" => "get_blacklist",
		"caller_number" => "123456",
		"format" => "json"      
	);
	echo post_data($base_url, $data);

	function post_data($url, $data){
		$fields = '';
		foreach($data as $key => $value) { 
			$fields .= $key . '=' . $value . '&'; 
		}
		rtrim($fields, '&');
		$post = curl_init();
		curl_setopt($post, CURLOPT_URL, $url);
		curl_setopt($post, CURLOPT_POST, count($data));
		curl_setopt($post, CURLOPT_POSTFIELDS, $fields);
		curl_setopt($post, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($post, CURLOPT_HTTPHEADER, array("Authorization: Bearer < TOKEN_FROM_SYSTEM >"));
		$result = curl_exec($post);
		curl_close($post);
		return $result; 
	}
?>
	

Parameters

Query parameters
Name Description
caller_number
format

Responses

Status: 200 - Success response

Status: 2001 - no results


Remove number from blacklist

This function purpose is to allow a number and/or prefix to be removed from the list of numbers banned from calling the maskyoo numbers within the system (i.e. "Blacklist").


/api/?service=remove_number_from_blacklist

Usage and SDK Samples


	curl -H "Authorization: Bearer < TOKEN_FROM_SYSTEM >" -X get "https://[MASKYOO_URL]/api/?service=remove_number_from_blacklist&caller_number=&format="
	

using System.Net;
using System.Collections.Specialized;
namespace Examples.System.Net
{
    public class WebRequestPostExample
    {
        public static void Main ()
        {
			string url_query_string="https://[MASKYOO_URL]/api/?";
			using (var client = new WebClient())
			{
				var values = new NameValueCollection();
				values["service"] = "remove_number_from_blacklist";
				values["caller_number"] = "1234";
				values["format"] = "json";

				client.Headers.Add("Authorization","Bearer < TOKEN_FROM_SYSTEM >");
                var response = client.UploadValues(url_query_string, values);

				var responseString = Encoding.Default.GetString(response);
				Console.WriteLine (responseString);
			}
        }
    }
}
	

<?php
	$base_url="https://[MASKYOO_URL]/api/";
	$data = array(
		"service" => "remove_number_from_blacklist",
		"caller_number" => "123456",
		"format" => "json"      
	);
	echo post_data($base_url, $data);

	function post_data($url, $data){
		$fields = '';
		foreach($data as $key => $value) { 
			$fields .= $key . '=' . $value . '&'; 
		}
		rtrim($fields, '&');
		$post = curl_init();
		curl_setopt($post, CURLOPT_URL, $url);
		curl_setopt($post, CURLOPT_POST, count($data));
		curl_setopt($post, CURLOPT_POSTFIELDS, $fields);
		curl_setopt($post, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($post, CURLOPT_HTTPHEADER, array("Authorization: Bearer < TOKEN_FROM_SYSTEM >"));
		$result = curl_exec($post);
		curl_close($post);
		return $result; 
	}
?>
	

Parameters

Query parameters
Name Description
caller_number*
format

Responses

Status: 200 - Success response

Status: 2011 - error the caller_number have to be numeric and can't be empty

Status: 2012 - error the number 0 not exist in blacklist

Status: 2013 - error the number didnt removed from blacklist


Generated 2017-02-01 12:00:00