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

Maskyoo API 16

Prompts Methods related

Get prompts list

This function return list of all prompts in the system in JSON or XML format.


/api/?service=get_prompts_list

Usage and SDK Samples


	curl -H "Authorization: Bearer < TOKEN_FROM_SYSTEM >" -X get "https://[MASKYOO_URL]/api/?service=get_prompts_list&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_prompts_list";
				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_prompts_list",                        
		"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
format

Responses

Status: 200 - Success response

Status: 9041 - there is no prompts


Download prompt

This function return prompt file and response in JSON or XML format.


/api/?service=download_prompt&prompt_name=

Usage and SDK Samples


	curl -H "Authorization: Bearer < TOKEN_FROM_SYSTEM >" -X get "https://[MASKYOO_URL]/api/?service=download_prompt&prompt_name=&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"] = "download_prompt";
				values["prompt_name"] = "some_file";
				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" => "download_prompt",                        
		"prompt_name" => "some_file",                        
		"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
prompt_name*
format

Responses

Status: 200 - Success response

Status: 9011 - error prompt_name cant be empty

Status: 9012 - error there is no prompt file with `some_file` name in the system


Upload prompt

This function upload prompt file and response in JSON or XML format.


/api/?service=upload_prompt

Usage and SDK Samples


	curl -H "Authorization: Bearer < TOKEN_FROM_SYSTEM >" -X POST -F "service=upload_prompt" -F "prompt_file=@/path/to/some_file.wav;filename=some_file;type=audio/wav;size=192654" "https://[MASKYOO_URL]/api/?service=upload_prompt&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"] = "upload_prompt";
				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' => 'upload_prompt',
		'prompt_file' =>'@'.$_FILES['prompt_file']['tmp_name'].';filename='.$_FILES['prompt_file']['name'].';type='.$_FILES['prompt_file']['type'].';size='.$_FILES['prompt_file']['size'],
		"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
prompt_file*
format

Responses

Status: 200 - Success response

Status: 9022 - error ther prompt file with `some_file` name already exist in the system

Status: 9023 - error the prompt file `some_file` is not valid audio expension

Status: 9024 - error the prompt file `some_file` size must be under 5Mb

Status: 9025 - error prompt `some_file` didnt add to the system


Delete prompt

This function delete prompt file and response in JSON or XML format.


/api/?service=delete_prompt&prompt_name=

Usage and SDK Samples


	curl -H "Authorization: Bearer < TOKEN_FROM_SYSTEM >" -X get "https://[MASKYOO_URL]/api/?service=delete_prompt&prompt_name=&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"] = "delete_prompt";
				values["prompt_name"] = "some_file";
				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" => "delete_prompt",                        
		"prompt_name" => "some_file",                        
		"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
prompt_name*
format

Responses

Status: 200 - Success response

Status: 9031 - error prompt_name cant be empty

Status: 9032 - error there is no prompt file with `some_file` name in the system

Status: 9033 - error there is no prompt file with `some_file` name didnt been delete from the system


Recording Studio

This function create a phone call to recording studio and save the record prompt file into the system and response in JSON or XML format.


/api/?service=recording_studio&destination=&format=

Usage and SDK Samples


	curl -H "Authorization: Bearer < TOKEN_FROM_SYSTEM >" -X get "https://[MASKYOO_URL]/api/?service=recording_studio&destination=&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"] = "recording_studio";
				values["destination"] = "972776670000";
				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" => "recording_studio",                        
		"destination" => "972776670000",                        
		"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
destination*
format

Responses

Status: 200 - Success response

Status: 9026 - error destination cant be empty


Generated 2017-02-01 12:00:00