Set up or edit Voicemail on a number
SetVoicemailDestination
Description
Set the Voicemail destination of a number.
Parameters
| string Number | The TTNC number which is to be modified. |
| string VoicemailEmailDests | List of destination email addresses, comma separated. |
| string VoicemailSMSDests | List of destination UK Mobile numbers, comma separated. Please note; Voicemail Alerts sent to Mobile numbers are SMSs which are chargeable. Please consult your pricing for details. |
| bool ReplaceForwarding | Sending this parameter as a value equivalent to TRUE will cause any call forwarding to telephone numbers or VoIP destinations to be overwritten so only Voicemail is present. |
| RequiredOptional | |
Request
- XML
- PHP
- Ruby
- Python
- C#
<?xml version="1.0"?>
<NoveroRequest>
<Request target="NoveroNumbers" name="SetVoicemailDestination" id="TestRequest">
<Number>01245123456</Number>
<VoicemailEmailDests>sales@ttnc.co.uk,support@ttnc.co.uk</VoicemailEmailDests>
<VoicemailSMSDests>07777000001,07777000002</VoicemailSMSDests>
</Request>
</NoveroRequest>
<?php
require_once('TTNCApi.php');
$Api = new TTNCApi('<username>', '<password>', '<VKey>');
$Request = $Api->NewRequest('NoveroNumbers', 'SetVoicemailDestination', 'TestRequest');
$Request->SetData('Number', '01245123456');
$Request->SetData('VoicemailEmailDests', 'sales@ttnc.co.uk,support@ttnc.co.uk');
$Request->SetData('VoicemailSMSDests', '07777000001,07777000002');
$Api->MakeRequests();
$Response = $Api->GetResponseFromId('TestRequest');
?>
require TTNCApi
api = TTNCApi.new('<username>', '<password>', '<vkey>')
request = api.newrequest('NoveroNumbers', 'SetVoicemailDestination', 'TestRequest')
request.setdata('Number', '01245123456')
request.setdata('VoicemailEmailDests', 'sales@ttnc.co.uk,support@ttnc.co.uk')
request.setdata('VoicemailSMSDests', '07777000001,07777000002')
api.makerequest()
p request.getresponse()
api = TTNCApi('<username>', '<password>', '<vkey>')
request = api.newrequest('NoveroNumbers', 'SetVoicemailDestination', 'TestRequest')
request.setdata('Number', '01245123456')
request.setdata('VoicemailEmailDests', 'sales@ttnc.co.uk,support@ttnc.co.uk')
request.setdata('VoicemailSMSDests', '07777000001,07777000002')
api.makerequest()
p request.getresponse()
using System;
using TTNCApi;
class Program
{
static void Main(string[] args)
{
TTNCApi api = new TTNCApi("<username>", "<password>", "<vkey>");
TTNCRequest request = api.NewRequest("NoveroNumbers", "SetVoicemailDestination", "TestRequest");
request.setData("Number", "01245123456");
request.setData("VoicemailEmailDests", "sales@ttnc.co.uk,support@ttnc.co.uk");
request.setData("VoicemailSMSDests", "07777000001,07777000002");
api.MakeRequests();
TTNCParser dic = request.GetResponse();
}
}
Response
<?xml version="1.0"?>
<NoveroResponse>
<Response target="NoveroNumbers" name="SetVoicemailDestination" Code="200" RequestId="TestRequest">
<ResponseMessage>Voicemail set up successfully</ResponseMessage>
<Success>Voicemail set up successfully</Success>
</Response>
</NoveroResponse>
EnableVoicemail
Description
Turn on Voicemail on the specified number.
Parameters
| string Number | The TTNC number which is to be modified. |
| RequiredOptional | |
Request
- XML
- PHP
- Ruby
- Python
- C#
<?xml version="1.0"?>
<NoveroRequest>
<Request target="NoveroNumbers" name="EnableVoicemail" id="TestRequest">
<Number>01245123456</Number>
</Request>
</NoveroRequest>
<?php
require_once('TTNCApi.php');
$Api = new TTNCApi('<username>', '<password>', '<VKey>');
$Request = $Api->NewRequest('NoveroNumbers', 'EnableVoicemail', 'TestRequest');
$Request->SetData('Number', '01245123456');
$Api->MakeRequests();
$Response = $Api->GetResponseFromId('TestRequest');
?>
require TTNCApi
api = TTNCApi.new('<username>', '<password>', '<vkey>')
request = api.newrequest('NoveroNumbers', 'EnableVoicemail', 'TestRequest')
request.setdata('Number', '01245123456')
api.makerequest()
p request.getresponse()
api = TTNCApi('<username>', '<password>', '<vkey>')
request = api.newrequest('NoveroNumbers', 'EnableVoicemail', 'TestRequest')
request.setdata('Number', '01245123456')
api.makerequest()
p request.getresponse()
using System;
using TTNCApi;
class Program
{
static void Main(string[] args)
{
TTNCApi api = new TTNCApi("<username>", "<password>", "<vkey>");
TTNCRequest request = api.NewRequest("NoveroNumbers", "EnableVoicemail", "TestRequest");
request.setData("Number", "01245123456");
api.MakeRequests();
TTNCParser dic = request.GetResponse();
}
}
Response
<?xml version="1.0"?>
<NoveroResponse>
<Response target="NoveroNumbers" name="EnableVoicemail" Code="200" RequestId="TestRequest">
<ResponseMessage></ResponseMessage>
<Success></Success>
</Response>
</NoveroResponse>
DisableVoicemail
Description
Turn off Voicemail on the specified number.
Parameters
| string Number | The TTNC number which is to be modified. |
| RequiredOptional | |
Request
- XML
- PHP
- Ruby
- Python
- C#
<?xml version="1.0"?>
<NoveroRequest>
<Request target="NoveroNumbers" name="DisableVoicemail" id="TestRequest">
<Number>01245123456</Number>
</Request>
</NoveroRequest>
<?php
require_once('TTNCApi.php');
$Api = new TTNCApi('<username>', '<password>', '<VKey>');
$Request = $Api->NewRequest('NoveroNumbers', 'DisableVoicemail', 'TestRequest');
$Request->SetData('Number', '01245123456');
$Api->MakeRequests();
$Response = $Api->GetResponseFromId('TestRequest');
?>
require TTNCApi
api = TTNCApi.new('<username>', '<password>', '<vkey>')
request = api.newrequest('NoveroNumbers', 'DisableVoicemail', 'TestRequest')
request.setdata('Number', '01245123456')
api.makerequest()
p request.getresponse()
api = TTNCApi('<username>', '<password>', '<vkey>')
request = api.newrequest('NoveroNumbers', 'DisableVoicemail', 'TestRequest')
request.setdata('Number', '01245123456')
api.makerequest()
p request.getresponse()
using System;
using TTNCApi;
class Program
{
static void Main(string[] args)
{
TTNCApi api = new TTNCApi("<username>", "<password>", "<vkey>");
TTNCRequest request = api.NewRequest("NoveroNumbers", "DisableVoicemail", "TestRequest");
request.setData("Number", "01245123456");
api.MakeRequests();
TTNCParser dic = request.GetResponse();
}
}
Response
<?xml version="1.0"?>
<NoveroResponse>
<Response target="NoveroNumbers" name="DisableVoicemail" Code="200" RequestId="TestRequest">
<ResponseMessage></ResponseMessage>
<Success></Success>
</Response>
</NoveroResponse>
EncodeAndGet
Description
Download a specified Voicemail message. The voicemails are WAVE audio, Microsoft PCM, 16 bit, mono and 8000 Hz. They are encapsulated XML CDATA and are base64 encoded.
Parameters
| int CDRUID | The unique identifier for the Call Data Record associated with the Voicemail. This can be retrieved from NoveroCDR::GetCDRs |
| RequiredOptional | |
Request
- XML
- PHP
- Ruby
- Python
- C#
<?xml version="1.0"?>
<NoveroRequest>
<Request target="NoveroVoicemails" name="EncodeAndGet" id="TestRequest">
<CDRUID>12345678</CDRUID>
</Request>
</NoveroRequest>
<?php
require_once('TTNCApi.php');
$Api = new TTNCApi('<username>', '<password>', '<VKey>');
$Request = $Api->NewRequest('NoveroVoicemails', 'EncodeAndGet', 'TestRequest');
$Request->SetData('CDRUID', '12345678');
$Api->MakeRequests();
$Response = $Api->GetResponseFromId('TestRequest');
?>
require TTNCApi
api = TTNCApi.new('<username>', '<password>', '<vkey>')
request = api.newrequest('NoveroVoicemails', 'EncodeAndGet', 'TestRequest')
request.setdata('CDRUID', '12345678')
api.makerequest()
p request.getresponse()
api = TTNCApi('<username>', '<password>', '<vkey>')
request = api.newrequest('NoveroVoicemails', 'EncodeAndGet', 'TestRequest')
request.setdata('CDRUID', '12345678')
api.makerequest()
p request.getresponse()
using System;
using TTNCApi;
class Program
{
static void Main(string[] args)
{
TTNCApi api = new TTNCApi("<username>", "<password>", "<vkey>");
TTNCRequest request = api.NewRequest("NoveroVoicemails", "EncodeAndGet", "TestRequest");
request.setData("CDRUID", "12345678");
api.MakeRequests();
TTNCParser dic = request.GetResponse();
}
}
Response
<?xml version="1.0"?>
<NoveroResponse>
<Response target="NoveroEvents" name="EncodeAndGet" Code="200" RequestId="TestRequest">
<Voicemail><![CDATA[ *Voicemail Audio Data* ]]></Voicemail>
</Response>
</NoveroResponse>
Download Voicemail
The example below demonstrates how to download a voicemail using the API. The resulting data can then be saved or streamed to a browser.
Depending on your application, you will firstly need to know the uid of the CDR the voicemail file relates too. This can be retrieved by searching for the specific CDR or you may already have it stored locally from a previous retrieval. To search for a specific CDR we can call the following Request
Request
<?xml version="1.0"?>
<NoveroRequest>
<Request target="Auth" name="SessionLogin" id="SessionRequest">
<Username>user@domain.com</Username>
<Password>secretpassword</Password>
<VKey>a9d64e4c3289e7a14b51baf8adfec60a</VKey>
</Request>
<Request target="NoveroCDR" name="GetCDRs" id="Request1">
<StartDate>2016-05-23</StartDate>
<EndDate>2016-05-24</EndDate>
<Number>01211234567</Number>
</Request>
</NoveroRequest>
Response
<?xml version="1.0"?>
<NoveroResponse>
<Response target="Auth" name="SessionLogin" Code="200" RequestId="SessionRequest">
<SessionId>676fb75612b1e3a5691f4969f6503378</SessionId>
</Response>
<Response target="NoveroCDR" name="GetCDRs" Code="200" RequestId="Request1">
<CDRs>
<CDR>
<uid>108119862</uid>
<ref>!5224557B6062F</ref>
<calldate>2013-09-02</calldate>
<calltime>10:08:11</calltime>
<anumber>1245123123</anumber>
<anumber_location>UK Chelmsford</anumber_location>
<bnumber>1211234567</bnumber>
<alias>-</alias>
<dialled>V:user@domain.com</dialled>
<dialled_location>Voice to Email</dialled_location>
<duration>15</duration>
<ring_time>0</ring_time>
<user_cost>0.005</user_cost>
<reason>1</reason>
<reason_q805>1</reason_q805>
</CDR>
<CDR>
<uid>108139023</uid>
<ref>!522485C6323B</ref>
<calldate>2013-09-02</calldate>
<calltime>13:34:14</calltime>
<anumber>1245123123</anumber>
<anumber_location>UK Chelmsford</anumber_location>
<bnumber>1211234567</bnumber>
<alias>-</alias>
<dialled>447512345678</dialled>
<dialled_location>UK O2 Mobile</dialled_location>
<duration>21</duration>
<ring_time>14</ring_time>
<user_cost>0.026</user_cost>
<reason>1</reason>
<reason_q805>1</reason_q805>
</CDR>
</CDRs>
</Response>
</NoveroResponse>
Using the
Request
<?xml version="1.0"?>
<NoveroRequest>
<Request target="Auth" name="SessionLogin" id="SessionRequest">
<Username>user@domain.com</Username>
<Password>secretpassword</Password>
<VKey>a9d64e4c3289e7a14b51baf8adfec60a</VKey>
</Request>
<Request target="NoveroVoicemails" name="EncodeAndGet" id="d70a66ac2f2591507529ca27d37e343f0edef8a2">
<CDRUID>108119862</CDRUID>
</Request>
</NoveroRequest>
The response contains the base64 encoded data representing the voicemail file itself. This can then be decoded and written to file or streamed to a client;
Response
<NoveroResponse>
<Response target="Auth" name="SessionLogin" Code="200" RequestId="SessionRequest">
<SessionId>676fb75612b1e3a5691f4969f6503378</SessionId>
</Response>
<Response target="NoveroEvents" name="EncodeAndGet" Code="200" RequestId="d70a66ac2f2591507529ca27d37e343f0edef8a2">
<Voicemail><![CDATA[ /* base64 encoded data */ ]]></Voicemail>
</Response>
</NoveroResponse>