Organization

Organize your OnSIP SIP addresses into domains, a.k.a. organizations.

Organization Add

Create a new organization in the specified account.

Authentication & Authorization

AuthenticationAuthorization
Authenticated Session Account Admin

Request Parameters

Required ParametersDescription
Action “OrganizationAdd”
SessionId Authenticated Session identifier.
AccountId A positive integer which references a unique account.
Name The contact name.
Address The contact address.
City The contact city.
State The contact state - the two letter state code.
Zipcode The contact zipcode.
CountryId A positive integer which references a unique country.
Phone The contact phone number.
Email The contact email address.
Username An authentication username which references a unique user.
Password A user’s login password (the password used to login to the web portal).
Optional ParametersDefaultDescription
Company ’’ The contact company or organization name.
PbxType ‘hosted’ Currently we only allow customers to add additional Hosted PBXs to a single account. Contact support for more options.
Domain ’’ A domain must contain ‘onsip.com’, i.e. it must be a subdomain of the onsip.com domain. This can be changed later using the OrganizationMigrateDomain action. By default, one is created using the authentication username as the subdomain, with underscores replaced with dashes.

Result Element Schema

OrganizationAdd.rnc:

OrganizationAdd.rng, Organization.rng, Contact.rng

Sample Request

cURL
1
2
3
4
curl -X POST \
--data \
'Action=OrganizationAdd&SessionId=5too9eipljjg3qbcmn9s01f1o5&AccountId=22543&Name=John&Address=55BroadSt&City=NYC&State=NY&Zipcode=10004&CountryId=1&Phone=5555555555&Email=john%40example.onsip.com&Username=docexample&Password=mysuperpassword' \
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
var data = new FormData();
data.append('Action', 'OrganizationAdd');
data.append('SessionId', '5too9eipljjg3qbcmn9s01f1o5');
data.append('AccountId', '22543');
data.append('Name', 'John');
data.append('Address', '55BroadSt');
data.append('City', 'NYC');
data.append('State', 'NY');
data.append('Zipcode', '10004');
data.append('CountryId', '1');
data.append('Phone', '5555555555');
data.append('Email', 'john@example.onsip.com');
data.append('Username', 'docexample');
data.append('Password', 'mysuperpassword');

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
<Response xmlns="http://www.jnctn.net/ns/rest/2006-01">
  <Context>
    <Action>
      <IsCompleted>true</IsCompleted>
    </Action>
    <Request>
      <IsValid>true</IsValid>
      <DateTime>2014-04-21T15:43:26+00:00</DateTime>
      <Duration>486</Duration>
      <Parameters>
        <Parameter>
          <Name>Action</Name>
          <Value>OrganizationAdd</Value>
        </Parameter>
        <Parameter>
          <Name>SessionId</Name>
          <Value>5too9eipljjg3qbcmn9s01f1o5</Value>
        </Parameter>
        <Parameter>
          <Name>AccountId</Name>
          <Value>22543</Value>
        </Parameter>
        <Parameter>
          <Name>Name</Name>
          <Value>John</Value>
        </Parameter>
        <Parameter>
          <Name>Address</Name>
          <Value>55BroadSt</Value>
        </Parameter>
        <Parameter>
          <Name>City</Name>
          <Value>NYC</Value>
        </Parameter>
        <Parameter>
          <Name>State</Name>
          <Value>NY</Value>
        </Parameter>
        <Parameter>
          <Name>Zipcode</Name>
          <Value>10004</Value>
        </Parameter>
        <Parameter>
          <Name>CountryId</Name>
          <Value>1</Value>
        </Parameter>
        <Parameter>
          <Name>Phone</Name>
          <Value>5555555555</Value>
        </Parameter>
        <Parameter>
          <Name>Email</Name>
          <Value>john@example.onsip.com</Value>
        </Parameter>
        <Parameter>
          <Name>Username</Name>
          <Value>docexample</Value>
        </Parameter>
        <Parameter>
          <Name>Password</Name>
          <Value>******</Value>
        </Parameter>
        <Parameter>
          <Name>Company</Name>
          <Value/>
        </Parameter>
        <Parameter>
          <Name>PbxType</Name>
          <Value>hosted</Value>
        </Parameter>
        <Parameter>
          <Name>UserRole</Name>
          <Value>User</Value>
        </Parameter>
      </Parameters>
    </Request>
    <Session>
      <IsEstablished>true</IsEstablished>
      <SessionId>5too9eipljjg3qbcmn9s01f1o5</SessionId>
      <UserId>152255</UserId>
      <Roles>
        <Role>
          <Name>Account Admin</Name>
        </Role>
      </Roles>
    </Session>
  </Context>
  <Result>
    <OrganizationAdd>
      <Organization>
        <OrganizationId>30899</OrganizationId>
        <AccountId>22543</AccountId>
        <Service>hosted</Service>
        <Domain>docexample.onsip.com</Domain>
        <CallerId/>
        <CallerIdName/>
        <CallerIdNumber/>
        <Status>enabled</Status>
        <ExtendedDialing>false</ExtendedDialing>
        <E911Provisioning>false</E911Provisioning>
        <BusyLampField>false</BusyLampField>
        <Authenticated>true</Authenticated>
        <RegistrationLimit>0</RegistrationLimit>
        <Modified>2014-04-21T15:43:26+00:00</Modified>
        <Created>2014-04-21T15:43:26+00:00</Created>
        <Contact>
          <Name>John</Name>
          <Organization/>
          <Address>55BroadSt</Address>
          <City>NYC</City>
          <State>NY</State>
          <Zipcode>10004</Zipcode>
          <Country>Afghanistan</Country>
          <CountryId>1</CountryId>
          <Phone>1-555-555-5555</Phone>
          <Email>john@example.onsip.com</Email>
          <Modified>2014-04-21T15:43:26+00:00</Modified>
        </Contact>
      </Organization>
    </OrganizationAdd>
  </Result>
</Response>

Organization Read

Returns information about an organization.

Authentication & Authorization

AuthenticationAuthorization
Authenticated Session Account Admin

Request Parameters

Required ParametersDescription
Action “OrganizationRead”
SessionId Authenticated Session identifier.
OrganizationId A positive integer which references a unique organization.
One and Only One of the Following ParametersDescription
OrganizationId A positive integer which references a unique organization.
Domain A fully qualified domain name which references a unique organization.

Result Element Schema

OrganizationRead.rnc:

OrganizationRead.rng, Organization.rng, Contact.rng

Sample Request

cURL
1
2
3
4
curl -X POST \
--data \
'Action=OrganizationRead&SessionId=5too9eipljjg3qbcmn9s01f1o5&OrganizationId=30899' \
https://api.onsip.com/api
JavaScript
1
2
3
4
5
6
7
8
9
10
11
var data = new FormData();
data.append('Action', 'OrganizationRead');
data.append('SessionId', '5too9eipljjg3qbcmn9s01f1o5');
data.append('OrganizationId', '30899');

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
<Response xmlns="http://www.jnctn.net/ns/rest/2006-01">
  <Context>
    <Action>
      <IsCompleted>true</IsCompleted>
    </Action>
    <Request>
      <IsValid>true</IsValid>
      <DateTime>2014-04-21T15:45:19+00:00</DateTime>
      <Duration>32</Duration>
      <Parameters>
        <Parameter>
          <Name>Action</Name>
          <Value>OrganizationRead</Value>
        </Parameter>
        <Parameter>
          <Name>SessionId</Name>
          <Value>5too9eipljjg3qbcmn9s01f1o5</Value>
        </Parameter>
        <Parameter>
          <Name>OrganizationId</Name>
          <Value>30899</Value>
        </Parameter>
      </Parameters>
    </Request>
    <Session>
      <IsEstablished>true</IsEstablished>
      <SessionId>5too9eipljjg3qbcmn9s01f1o5</SessionId>
      <UserId>152255</UserId>
      <Roles>
        <Role>
          <Name>Account Admin</Name>
        </Role>
      </Roles>
    </Session>
  </Context>
  <Result>
    <OrganizationRead>
      <Organization>
        <OrganizationId>30899</OrganizationId>
        <AccountId>22543</AccountId>
        <Service>hosted</Service>
        <Domain>docexample.onsip.com</Domain>
        <CallerId/>
        <CallerIdName/>
        <CallerIdNumber/>
        <Status>enabled</Status>
        <ExtendedDialing>false</ExtendedDialing>
        <E911Provisioning>false</E911Provisioning>
        <BusyLampField>false</BusyLampField>
        <Authenticated>true</Authenticated>
        <RegistrationLimit>0</RegistrationLimit>
        <Modified>2014-04-21T15:43:26+00:00</Modified>
        <Created>2014-04-21T15:43:26+00:00</Created>
        <Contact>
          <Name>John</Name>
          <Organization/>
          <Address>55BroadSt</Address>
          <City>NYC</City>
          <State>NY</State>
          <Zipcode>10004</Zipcode>
          <Country>Afghanistan</Country>
          <CountryId>1</CountryId>
          <Phone>1-555-555-5555</Phone>
          <Email>john@example.onsip.com</Email>
          <Modified>2014-04-21T15:43:26+00:00</Modified>
        </Contact>
      </Organization>
    </OrganizationRead>
  </Result>
</Response>

Organization Browse

Authentication & Authorization

AuthenticationAuthorization
Authenticated Session Account Admin

Request Parameters

Required ParametersDescription
Action “OrganizationBrowse”
SessionId Authenticated Session identifier.
AccountId A positive integer which references a unique Account.
Optional ParametersDefaultDescription
OrderBy OrganizationId Domain | OrganizationId
Limit 20 The maximum number of records to return.
Offset 0 The offset of the first record to return. The offset of the initial record is 0 (not 1).
CalcFound true Calculate how many records there would be in the result set, disregarding any Limit parameter.

Result Element Schema

OrganizationBrowse.rnc:

OrganizationBrowse.rng, Organization.rng

Sample Request

cURL
1
2
3
4
curl -X POST \
--data \
'Action=OrganizationBrowse&SessionId=5too9eipljjg3qbcmn9s01f1o5&AccountId=22543' \
https://api.onsip.com/api
JavaScript
1
2
3
4
5
6
7
8
9
10
11
var data = new FormData();
data.append('Action', 'OrganizationBrowse');
data.append('SessionId', '5too9eipljjg3qbcmn9s01f1o5');
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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
<Response xmlns="http://www.jnctn.net/ns/rest/2006-01">
  <Context>
    <Action>
      <IsCompleted>true</IsCompleted>
    </Action>
    <Request>
      <IsValid>true</IsValid>
      <DateTime>2014-04-21T15:45:59+00:00</DateTime>
      <Duration>25</Duration>
      <Parameters>
        <Parameter>
          <Name>Action</Name>
          <Value>OrganizationBrowse</Value>
        </Parameter>
        <Parameter>
          <Name>SessionId</Name>
          <Value>5too9eipljjg3qbcmn9s01f1o5</Value>
        </Parameter>
        <Parameter>
          <Name>AccountId</Name>
          <Value>22543</Value>
        </Parameter>
        <Parameter>
          <Name>OrderBy</Name>
          <Value>OrganizationId</Value>
        </Parameter>
        <Parameter>
          <Name>Limit</Name>
          <Value>20</Value>
        </Parameter>
        <Parameter>
          <Name>Offset</Name>
          <Value>0</Value>
        </Parameter>
        <Parameter>
          <Name>CalcFound</Name>
          <Value>true</Value>
        </Parameter>
      </Parameters>
    </Request>
    <Session>
      <IsEstablished>true</IsEstablished>
      <SessionId>5too9eipljjg3qbcmn9s01f1o5</SessionId>
      <UserId>152255</UserId>
      <Roles>
        <Role>
          <Name>Account Admin</Name>
        </Role>
      </Roles>
    </Session>
  </Context>
  <Result>
    <OrganizationBrowse>
      <Organizations Limit="20" Offset="0" Found="2">
        <Organization>
          <OrganizationId>25018</OrganizationId>
          <AccountId>22543</AccountId>
          <Service>hosted</Service>
          <Domain>example.onsip.com</Domain>
          <CallerId/>
          <CallerIdName/>
          <CallerIdNumber/>
          <Status>enabled</Status>
          <ExtendedDialing>false</ExtendedDialing>
          <E911Provisioning>false</E911Provisioning>
          <BusyLampField>false</BusyLampField>
          <Authenticated>true</Authenticated>
          <RegistrationLimit>0</RegistrationLimit>
          <Modified>2013-06-03T13:47:29+00:00</Modified>
          <Created>2013-06-03T13:47:29+00:00</Created>
          <Contact>
            <Name>John Example</Name>
            <Organization>eaxample</Organization>
            <Address>55 broad street</Address>
            <City>Brooklyn</City>
            <State>NY</State>
            <Zipcode>11201</Zipcode>
            <Country>United States of America</Country>
            <CountryId>207</CountryId>
            <Phone>1-555-555-5555</Phone>
            <Email>john@example.onsip.com</Email>
            <Modified>2013-06-03T13:47:29+00:00</Modified>
          </Contact>
        </Organization>
        <Organization>
          <OrganizationId>30899</OrganizationId>
          <AccountId>22543</AccountId>
          <Service>hosted</Service>
          <Domain>docexample.onsip.com</Domain>
          <CallerId/>
          <CallerIdName/>
          <CallerIdNumber/>
          <Status>enabled</Status>
          <ExtendedDialing>false</ExtendedDialing>
          <E911Provisioning>false</E911Provisioning>
          <BusyLampField>false</BusyLampField>
          <Authenticated>true</Authenticated>
          <RegistrationLimit>0</RegistrationLimit>
          <Modified>2014-04-21T15:43:26+00:00</Modified>
          <Created>2014-04-21T15:43:26+00:00</Created>
          <Contact>
            <Name>John</Name>
            <Organization/>
            <Address>55BroadSt</Address>
            <City>NYC</City>
            <State>NY</State>
            <Zipcode>10004</Zipcode>
            <Country>Afghanistan</Country>
            <CountryId>1</CountryId>
            <Phone>1-555-555-5555</Phone>
            <Email>john@example.onsip.com</Email>
            <Modified>2014-04-21T15:43:26+00:00</Modified>
          </Contact>
        </Organization>
      </Organizations>
      <SearchMap>
        <SearchFields>
          <SearchField>
            <Display>Contact</Display>
            <Name>Contact</Name>
            <Type>string</Type>
          </SearchField>
          <SearchField>
            <Display>Name</Display>
            <Name>Name</Name>
            <Type>string</Type>
          </SearchField>
          <SearchField>
            <Display>Email</Display>
            <Name>Email</Name>
            <Type>string</Type>
          </SearchField>
          <SearchField>
            <Display>Domain</Display>
            <Name>Domain</Name>
            <Type>string</Type>
          </SearchField>
          <SearchField>
            <Display>Organization Id</Display>
            <Name>OrganizationId</Name>
            <Type>int</Type>
          </SearchField>
          <SearchField>
            <Display>Account Id</Display>
            <Name>AccountId</Name>
            <Type>int</Type>
          </SearchField>
        </SearchFields>
        <SearchCompOps>
          <SearchCompOp>
            <Desc>Contains</Desc>
            <SupportedTypes>
              <Type>string</Type>
              <Type>float</Type>
              <Type>int</Type>
            </SupportedTypes>
          </SearchCompOp>
          <SearchCompOp>
            <Desc>Equals</Desc>
            <SupportedTypes>
              <Type>float</Type>
              <Type>int</Type>
              <Type>string</Type>
            </SupportedTypes>
          </SearchCompOp>
          <SearchCompOp>
            <Desc>Begins With</Desc>
            <SupportedTypes>
              <Type>string</Type>
            </SupportedTypes>
          </SearchCompOp>
          <SearchCompOp>
            <Desc>Ends With</Desc>
            <SupportedTypes>
              <Type>string</Type>
            </SupportedTypes>
          </SearchCompOp>
          <SearchCompOp>
            <Desc>Greater Than</Desc>
            <SupportedTypes>
              <Type>float</Type>
              <Type>int</Type>
            </SupportedTypes>
          </SearchCompOp>
          <SearchCompOp>
            <Desc>Less Than</Desc>
            <SupportedTypes>
              <Type>float</Type>
              <Type>int</Type>
            </SupportedTypes>
          </SearchCompOp>
        </SearchCompOps>
      </SearchMap>
    </OrganizationBrowse>
  </Result>
</Response>

Organization Edit Contact

Update the Contact record associated with the organization.

Authentication & Authorization

AuthenticationAuthorization
Authenticated Session Organization Admin

Request Parameters

Required ParametersDescription
Action “OrganizationEditContact”
SessionId Authenticated Session identifier.
OrganizationId A positive integer which references a unique Organization.
Name The contact name.
Address The contact address.
City The contact city.
State The contact state - the two letter state code.
Zipcode The contact zipcode.
CountryId A positive integer which references a unique Country.
Phone The contact phone number.
Email The contact email address.
Organization The contact company or organization name.

Result Element Schema

OrganizationEditContact.rnc:

OrganizationEditContact.rng, Organization.rng, Contact.rng

Sample Request

cURL
1
2
3
4
curl -X POST \
--data \
'Action=OrganizationEditContact&SessionId=5too9eipljjg3qbcmn9s01f1o5&OrganizationId=30899&Name=notJohn&Address=56BroadSt&City=Brooklyn&State=NY&Zipcode=11201&CountryId=1&Phone=6666666666&Email=notjohn%40example.onsip.com&Organization=docexamples' \
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
var data = new FormData();
data.append('Action', 'OrganizationEditContact');
data.append('SessionId', '5too9eipljjg3qbcmn9s01f1o5');
data.append('OrganizationId', '30899');
data.append('Name', 'notJohn');
data.append('Address', '56BroadSt');
data.append('City', 'Brooklyn');
data.append('State', 'NY');
data.append('Zipcode', '11201');
data.append('CountryId', '1');
data.append('Phone', '6666666666');
data.append('Email', 'notjohn@example.onsip.com');
data.append('Organization', 'docexamples');

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
<Response xmlns="http://www.jnctn.net/ns/rest/2006-01">
  <Context>
    <Action>
      <IsCompleted>true</IsCompleted>
    </Action>
    <Request>
      <IsValid>true</IsValid>
      <DateTime>2014-04-21T15:48:48+00:00</DateTime>
      <Duration>48</Duration>
      <Parameters>
        <Parameter>
          <Name>Action</Name>
          <Value>OrganizationEditContact</Value>
        </Parameter>
        <Parameter>
          <Name>SessionId</Name>
          <Value>5too9eipljjg3qbcmn9s01f1o5</Value>
        </Parameter>
        <Parameter>
          <Name>OrganizationId</Name>
          <Value>30899</Value>
        </Parameter>
        <Parameter>
          <Name>Name</Name>
          <Value>notJohn</Value>
        </Parameter>
        <Parameter>
          <Name>Address</Name>
          <Value>56BroadSt</Value>
        </Parameter>
        <Parameter>
          <Name>City</Name>
          <Value>Brooklyn</Value>
        </Parameter>
        <Parameter>
          <Name>State</Name>
          <Value>NY</Value>
        </Parameter>
        <Parameter>
          <Name>Zipcode</Name>
          <Value>11201</Value>
        </Parameter>
        <Parameter>
          <Name>CountryId</Name>
          <Value>1</Value>
        </Parameter>
        <Parameter>
          <Name>Phone</Name>
          <Value>6666666666</Value>
        </Parameter>
        <Parameter>
          <Name>Email</Name>
          <Value>notjohn@example.onsip.com</Value>
        </Parameter>
        <Parameter>
          <Name>Organization</Name>
          <Value>docexamples</Value>
        </Parameter>
        <Parameter>
          <Name>UpdateDescendents</Name>
          <Value/>
        </Parameter>
      </Parameters>
    </Request>
    <Session>
      <IsEstablished>true</IsEstablished>
      <SessionId>5too9eipljjg3qbcmn9s01f1o5</SessionId>
      <UserId>152255</UserId>
      <Roles>
        <Role>
          <Name>Account Admin</Name>
        </Role>
      </Roles>
    </Session>
  </Context>
  <Result>
    <OrganizationEditContact>
      <Organization>
        <OrganizationId>30899</OrganizationId>
        <AccountId>22543</AccountId>
        <Service>hosted</Service>
        <Domain>docexample.onsip.com</Domain>
        <CallerId/>
        <CallerIdName/>
        <CallerIdNumber/>
        <Status>enabled</Status>
        <ExtendedDialing>false</ExtendedDialing>
        <E911Provisioning>false</E911Provisioning>
        <BusyLampField>false</BusyLampField>
        <Authenticated>true</Authenticated>
        <RegistrationLimit>0</RegistrationLimit>
        <Modified>2014-04-21T15:43:26+00:00</Modified>
        <Created>2014-04-21T15:43:26+00:00</Created>
        <Contact>
          <Name>John</Name>
          <Organization/>
          <Address>55BroadSt</Address>
          <City>NYC</City>
          <State>NY</State>
          <Zipcode>10004</Zipcode>
          <Country>Afghanistan</Country>
          <CountryId>1</CountryId>
          <Phone>1-555-555-5555</Phone>
          <Email>john@example.onsip.com</Email>
          <Modified>2014-04-21T15:43:26+00:00</Modified>
        </Contact>
      </Organization>
    </OrganizationEditContact>
  </Result>
</Response>

Organization Migrate Domain

Migrates the domain of the organization so as to allow custom domains. If you are an agent creating accounts for your custom domain, you must first create the account by using the AgentAddAccount action.

You can get the required OrganizationId parameter by doing an Organization Read.

The recommended and supported approach for a customer hosting their SIP domain with us is for them to create an SRV record for _sip._udp.<domain> to point to target sip.onsip.com on port 5060. SRV TCP records are NOT allowed yet.

Authentication & Authorization

AuthenticationAuthorization
Authenticated Session Organization Admin

Request Parameters

Required ParametersDescription
Action “OrganizationMigrateDomain”
SessionId Authenticated Session identifier.
OrganizationId A positive integer which references a unique Organization.
OldDomain The old domain. It must be an existing domain.
NewDomain The domain that is being migrated to. This new domain must have a SRV record associated with it.

Result Element Schema

OrganizationMigrateDomain.rnc:

OrganizationMigrateDomain.rng, Organization.rng, Contact.rng

Sample Request

cURL
1
2
3
4
curl -X POST \
--data \
'Action=OrganizationMigrateDomain&SessionId=5too9eipljjg3qbcmn9s01f1o5&OrganizationId=30899&OldDomain=docexample.onsip.com&NewDomain=egreencomputing.com' \
https://api.onsip.com/api
JavaScript
1
2
3
4
5
6
7
8
9
10
11
12
13
var data = new FormData();
data.append('Action', 'OrganizationMigrateDomain');
data.append('SessionId', '5too9eipljjg3qbcmn9s01f1o5');
data.append('OrganizationId', '30899');
data.append('OldDomain', 'docexample.onsip.com');
data.append('NewDomain', 'example.newdomain.com');

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
<Response xmlns="http://www.jnctn.net/ns/rest/2006-01">
  <Context>
    <Action>
      <IsCompleted>true</IsCompleted>
    </Action>
    <Request>
      <IsValid>true</IsValid>
      <DateTime>2014-04-21T16:06:15+00:00</DateTime>
      <Duration>267</Duration>
      <Parameters>
        <Parameter>
          <Name>Action</Name>
          <Value>OrganizationMigrateDomain</Value>
        </Parameter>
        <Parameter>
          <Name>SessionId</Name>
          <Value>5too9eipljjg3qbcmn9s01f1o5</Value>
        </Parameter>
        <Parameter>
          <Name>OrganizationId</Name>
          <Value>30899</Value>
        </Parameter>
        <Parameter>
          <Name>OldDomain</Name>
          <Value>docexample.onsip.com</Value>
        </Parameter>
        <Parameter>
          <Name>NewDomain</Name>
          <Value>example.newdomain.com</Value>
        </Parameter>
      </Parameters>
    </Request>
    <Session>
      <IsEstablished>true</IsEstablished>
      <SessionId>5too9eipljjg3qbcmn9s01f1o5</SessionId>
      <UserId>152255</UserId>
      <Roles>
        <Role>
          <Name>Account Admin</Name>
        </Role>
      </Roles>
    </Session>
  </Context>
  <Result>
    <OrganizationMigrateDomain>
      <Organization>
        <OrganizationId>30899</OrganizationId>
        <AccountId>22543</AccountId>
        <Service>hosted</Service>
        <Domain>example.newdomain.com</Domain>
        <CallerId/>
        <CallerIdName/>
        <CallerIdNumber/>
        <Status>enabled</Status>
        <ExtendedDialing>false</ExtendedDialing>
        <E911Provisioning>false</E911Provisioning>
        <BusyLampField>false</BusyLampField>
        <Authenticated>true</Authenticated>
        <RegistrationLimit>0</RegistrationLimit>
        <Modified>2014-04-21T16:06:16+00:00</Modified>
        <Created>2014-04-21T15:43:26+00:00</Created>
        <Contact>
          <Name>notJohn</Name>
          <Organization>docexamples</Organization>
          <Address>56BroadSt</Address>
          <City>Brooklyn</City>
          <State>NY</State>
          <Zipcode>11201</Zipcode>
          <Country>Afghanistan</Country>
          <CountryId>1</CountryId>
          <Phone>1-666-666-6666</Phone>
          <Email>notjohn@example.onsip.com</Email>
          <Modified>2014-04-21T15:48:49+00:00</Modified>
        </Contact>
      </Organization>
    </OrganizationMigrateDomain>
  </Result>
</Response>

Organization Edit Authenticated

Set whether the organization’s users are required to provide their SIP Password when registering to the organization’s domain.

Authenticated users can send SIP traffic directly to third-parties, while anonymous sources (such as WebRTC buttons) cannot.

You can get the required OrganizationId parameter by doing an Organization Read.

Authentication & Authorization

AuthenticationAuthorization
Authenticated Session Organization Admin

Request Parameters

Required ParametersDescription
Action “OrganizationEditAuthenticated”
SessionId Authenticated Session identifier.
OrganizationId A positive integer which references a unique Organization.
Enabled Whether the domain should be authenticated.

Result Element Schema

OrganizationEditAuthenticated.rnc:

OrganizationEditAuthenticated.rng, Organization.rng

Sample Request

cURL
1
2
3
4
curl -X POST \
--data \
'Action=OrganizationEditAuthenticated&SessionId=5too9eipljjg3qbcmn9s01f1o5&OrganizationId=30899&Enabled=true' \
https://api.onsip.com/api
JavaScript
1
2
3
4
5
6
7
8
9
10
11
12
var data = new FormData();
data.append('Action', 'OrganizationEditAuthenticated');
data.append('SessionId', '5too9eipljjg3qbcmn9s01f1o5');
data.append('OrganizationId', '30899');
data.append('Enabled', 'true');

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
<Response xmlns="http://www.jnctn.net/ns/rest/2006-01">
  <Context>
    <Action>
      <IsCompleted>true</IsCompleted>
    </Action>
    <Request>
      <IsValid>true</IsValid>
      <DateTime>2014-04-21T15:58:24+00:00</DateTime>
      <Duration>33</Duration>
      <Parameters>
        <Parameter>
          <Name>Action</Name>
          <Value>OrganizationEditAuthenticated</Value>
        </Parameter>
        <Parameter>
          <Name>SessionId</Name>
          <Value>5too9eipljjg3qbcmn9s01f1o5</Value>
        </Parameter>
        <Parameter>
          <Name>OrganizationId</Name>
          <Value>30899</Value>
        </Parameter>
        <Parameter>
          <Name>Enabled</Name>
          <Value>true</Value>
        </Parameter>
      </Parameters>
    </Request>
    <Session>
      <IsEstablished>true</IsEstablished>
      <SessionId>5too9eipljjg3qbcmn9s01f1o5</SessionId>
      <UserId>152255</UserId>
      <Roles>
        <Role>
          <Name>Account Admin</Name>
        </Role>
      </Roles>
    </Session>
  </Context>
  <Result>
    <OrganizationEditAuthenticated>
      <Organization>
        <OrganizationId>30899</OrganizationId>
        <AccountId>22543</AccountId>
        <Service>hosted</Service>
        <Domain>docexample.onsip.com</Domain>
        <CallerId/>
        <CallerIdName/>
        <CallerIdNumber/>
        <Status>enabled</Status>
        <ExtendedDialing>false</ExtendedDialing>
        <E911Provisioning>false</E911Provisioning>
        <BusyLampField>false</BusyLampField>
        <Authenticated>true</Authenticated>
        <RegistrationLimit>0</RegistrationLimit>
        <Modified>2014-04-21T15:48:49+00:00</Modified>
        <Created>2014-04-21T15:43:26+00:00</Created>
        <Contact>
          <Name>notJohn</Name>
          <Organization>docexamples</Organization>
          <Address>56BroadSt</Address>
          <City>Brooklyn</City>
          <State>NY</State>
          <Zipcode>11201</Zipcode>
          <Country>Afghanistan</Country>
          <CountryId>1</CountryId>
          <Phone>1-666-666-6666</Phone>
          <Email>notjohn@example.onsip.com</Email>
          <Modified>2014-04-21T15:48:49+00:00</Modified>
        </Contact>
      </Organization>
    </OrganizationEditAuthenticated>
  </Result>
</Response>

Topics: Developer Docs