Voicemail

AdvVoicemailboxAdd

Add a voicemail box to an organization. This Action is simply for creating a new voicemailbox. Once created, use User Address Edit to set the DefaultAddress to rollover to voicemail after a set Timeout.

Authentication & Authorization

Authentication Authorization
Authenticated Session Account Admin

Request Parameters

Parameters Description
Action “AdvVoicemailboxAdd”
SessionId Authenticated Session identifier.
OrganizationId A positive integer which references a unique Organization.
Domain The domain of the sip address of the new voicemailbox.
Username The username of the sip address of the new voicemailbox.
Mailbox A postive integer which identifies the new mailbox.
Email An e-mail address to send messages to on receipt of voicemail.
EmailOptions

If an email is to be sent about the message, this is used to determine if the message should be attached, and further if it should be attached and removed from the box. The argument takes the form of:  {'attach': 'no'|'yes'|'yes-then-delete'}

Pager The email address that a shorter message will be sent to if desired.
Mwi The address that the message waiting indicator will be sent to (endpoint must support this).
Timezone The timezone to announce times in, in TZ database format (for ex: 'US/Eastern')
SayCallerId Boolean value. If true, Caller ID information will be announced before each message is played (when listening via the Voicemail Manager).
SayDuration Boolean value. If true, the duration of the message will be announced before each message is played (when listening via the Voicemail Manager).
SayDateTime SayDateTime: Boolean value. If true, the date and time of the message will be announced before each message is played (when listening via the Voicemail Manager).
TransferAddressUsername Username of another valid address in the same domain as the mailbox. If anyone calls the mailbox, they have the option of pressing 0 to transfer to that user rather than leave a message.

Sample Request

cURL
1
2
3
4
curl -X POST \
--data \
'Action=AdvVoicemailboxAdd&SessionId=42DnOx18VZquAfE6MjM8kmd4UERCxU5t&OrganizationId=25018&Domain=onsnip.onsip.com&Username=vm.test3&SayDuration=true&SayDateTime=true&SayCallerId=true&TransferAddressUsername=test4&Mwi=test3@onsnip.onsip.com&Mailbox=4321&Pager=&Email=&Timezone=US/Eastern&EmailOptions[attach]=no
https://api.onsip.com/api
JavaScript
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 19
20
21
22
23
var data = new FormData();
data.append('Action', 'AdvVoicemailboxAdd');
data.append('SessionId', 'nlibgopjksp2bel1ai22lp37l4');
data.append('OrganizationId', '25018')
data.append('Username', 'vm.test3');
data.append('SayDuration', 'true');
data.append('SayDateTime', 'true');
data.append('SayCallerId', 'true');
data.append('TransferAddressUsername', 'test4');
data.append('Mwi', 'test3@onsnip.onsip.com');
data.append('Mailbox', '4321');
data.append('Email', '');
data.append('Pager', '');
data.append('Timezone', 'US/Eastern');
data.append('EmailOptions[attach]', 'no');
data.append('AccountId', '22543');

var xhr = new XMLHttpRequest();
xhr.open('POST', 'https://api.onsip.com/api', true);
xhr.onload = function () {
console.log(this.responseText);
}
xhr.send(data);

Sample Response

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
<?xml version="1.0" encoding="UTF-8"?>
<Response xmlns="http://www.jnctn.net/ns/rest/2006-01">
  <Context>
    <Action>
      <IsCompleted>true</IsCompleted>
    </Action>
    <Request>
      <IsValid>true</IsValid>
      <DateTime>2018-01-26T18:04:10+00:00</DateTime>
      <Duration>347</Duration>
      <Parameters>
        <Parameter>
          <Name>Action</Name>
          <Value>AdvVoicemailboxAdd</Value>
        </Parameter>
        <Parameter>
          <Name>SessionId</Name>
          <Value>42DnOx18VZquAfE6MjM8kmd4UERCxU5t</Value>
        </Parameter>
        <Parameter>
          <Name>OrganizationId</Name>
          <Value>25018</Value>
        </Parameter>
        <Parameter>
          <Name>Domain</Name>
          <Value>onsnip.onsip.com</Value>
        </Parameter>
        <Parameter>
          <Name>Username</Name>
          <Value>vm.test3</Value>
        </Parameter>
        <Parameter>
          <Name>SayDuration</Name>
          <Value>true</Value>
        </Parameter>
        <Parameter>
          <Name>SayDateTime</Name>
          <Value>true</Value>
        </Parameter>
        <Parameter>
          <Name>SayCallerId</Name>
          <Value>true</Value>
        </Parameter>
        <Parameter>
          <Name>TransferAddressUsername</Name>
          <Value>test4</Value>
        </Parameter>
        <Parameter>
          <Name>Mwi</Name>
          <Value>test3@onsnip.onsip.com</Value>
        </Parameter>
        <Parameter>
          <Name>Mailbox</Name>
          <Value>4321</Value>
        </Parameter>
        <Parameter>
          <Name>Pager</Name>
          <Value/>
        </Parameter>
        <Parameter>
          <Name>Email</Name>
          <Value/>
        </Parameter>
        <Parameter>
          <Name>Timezone</Name>
          <Value>US/Eastern</Value>
        </Parameter>
        <Parameter>
          <Name>EmailOptions</Name>
          <Array>
            <Elements>
              <Element>
                <Key>attach</Key>
                <Value>no</Value>
              </Element>
            </Elements>
          </Array>
        </Parameter>
        <Parameter>
          <Name>Name</Name>
          <Value>vm.test3</Value>
        </Parameter>
      </Parameters>
    </Request>
    <Session>
      <IsEstablished>true</IsEstablished>
      <SessionId>42DnOx18VZquAfE6MjM8kmd4UERCxU5p</SessionId>
      <UserId>152255</UserId>
      <Roles>
        <Role>
          <Name>Account Admin</Name>
        </Role>
      </Roles>
    </Session>
  </Context>
  <Result>
    <AdvVoicemailboxAdd>
      <AdvVoicemailbox>
        <AdvVoicemailboxId>50010</AdvVoicemailboxId>
        <AppId>159925</AppId>
        <OrganizationId>25018</OrganizationId>
        <AccountId>22543</AccountId>
        <Domain>onsnip.onsip.com</Domain>
        <Mailbox>4321</Mailbox>
        <Name>vm.test3</Name>
        <Email/>
        <EmailOptions>
          <attach>no</attach>
        </EmailOptions>
        <Pager/>
        <Mwi>test3@onsnip.onsip.com</Mwi>
        <Timezone>US/Eastern</Timezone>
        <SayCallerId>true</SayCallerId>
        <SayDuration>true</SayDuration>
        <SayDateTime>true</SayDateTime>
        <Password>7489</Password>
        <Modified>2018-01-26T18:04:10+00:00</Modified>
        <Created>2018-01-26T18:04:10+00:00</Created>
        <TransferAddress>
          <AddressId>1982121</AddressId>
          <Username>test4</Username>
          <Domain>onsnip.onsip.com</Domain>
          <Type>user</Type>
          <Name>test4</Name>
        </TransferAddress>
        <Voicemail>
          <Greetings/>
          <Inbox/>
        </Voicemail>
      </AdvVoicemailbox>
    </AdvVoicemailboxAdd>
  </Result>
</Response>

AdvVoicemailboxDelete

Delete a given Voicemailbox.

Authentication & Authorization

Authentication Authorization
Authenticated Session Account Admin

Request Parameters

Required Parameters Description
Action “AdvVoicemailboxDelete”
SessionId Authenticated Session identifier.
AdvVoicemailboxId A positive integer which references a unique AdvVoicemailbox.

Sample Request

cURL
1
2
3
4
curl -X POST \
--data \
'Action=AdvVoicemailboxDelete&SessionId=42DnOx18VZquAfE6MjM8kmd4UERCxU5t&AdvVoicemailboxId=50010' \
https://api.onsip.com/api
JavaScript
1
2
3
4
5
6
7
8
9
10
11
var data = new FormData();
data.append('Action', 'AdvVoicemailboxDelete');
data.append('SessionId', 'nlibgopjksp2bel1ai22lp37l4');
data.append('AdvVoicemailboxId', '50010');

var xhr = new XMLHttpRequest();
xhr.open('POST', 'https://api.onsip.com/api', true);
xhr.onload = function () {
  console.log(this.responseText);
}
xhr.send(data);

Sample Response

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?xml version="1.0" encoding="UTF-8"?>
<Response xmlns="http://www.jnctn.net/ns/rest/2006-01">
  <Context>
    <Action>
      <IsCompleted>true</IsCompleted>
    </Action>
    <Request>
      <IsValid>true</IsValid>
      <DateTime>2018-01-26T18:13:37+00:00</DateTime>
      <Duration>282</Duration>
      <Parameters>
        <Parameter>
          <Name>Action</Name>
          <Value>AdvVoicemailboxDelete</Value>
        </Parameter>
        <Parameter>
          <Name>SessionId</Name>
          <Value>42DnOx18VZquAfE6MjM8kmd4UERCxU5t</Value>
        </Parameter>
        <Parameter>
          <Name>AdvVoicemailboxId</Name>
          <Value>50010</Value>
        </Parameter>
      </Parameters>
    </Request>
    <Session>
      <IsEstablished>true</IsEstablished>
      <SessionId>42DnOx18VZquAfE6MjM8kmd4UERCxU5p</SessionId>
      <UserId>152255</UserId>
      <Roles>
        <Role>
          <Name>Account Admin</Name>
        </Role>
      </Roles>
    </Session>
  </Context>
  <Result>
    <AdvVoicemailboxDelete/>
  </Result>
</Response>

Topics: Developer Docs