Agent

Agent Add Account

As an Agent, this request creates a new account. Immediately after the account is created, the OnSIP branded billing emails are sent to the email address.

If you are adding an account that you want to host on your own custom domain, then you need to do an AgentAddAccount action followed by a OrganizationMigrateDomain action.

Authentication & Authorization

AuthenticationAuthorization
Authenticated Session Agent Admin

Request Parameters

Required ParametersDescription
Action “AgentAddAccount”
SessionId Authenticated Session identifier.
Username The portal username as well as the username portion of the hosted pbx user address. This is used to generate the admin user’s AuthUsername. It must be equal to the subdomain of Domain.
Domain A fully qualified domain name suffixed with the onsip.com domain. The Username must be a substring of the subdomain, i.e. if Username=dude_user, then Domain=my-dude-user.onsip.com. Notice that underscores are replaced with dashes.
Name A human readable name
Company The name of the company of the account being created
Address The contact address
City The city parameter of the address
State The state parameter of the address
Zipcode The zipcode parameter of the address
Phone The contact phone number. No country codes or IDs are accepted.
Email A valid email address. This email will receive billing emails, feature/product change emails, used by support to address account-level bug reports. The admin user created by this signup account will be assigned this email address.
Password A user’s login password (the password used to log into the web portal). Used to generate API sessions and log into the admin portal to make account wide changes.
Productcode This should be “onSIP”.
Creditcard This should be “false”

Result Element Schema

AgentAddAccount.rnc:

AgentAddAccount.rng

Sample Request

cURL
1
2
3
4
curl -X POST \
--data \
'Action=AgentAddAccount&SessionId=5dn35864tvqim0lt1t26vqg4l6&Username=example&Domain=example.onsip.com&Name=john&Company=agentsanonymous&Address=28AgentStreet&City=Agent&State=NY&Zipcode=10004&Phone=15555555555&Email=john%40example.onsip.com&Password=testing&Productcode=onSIP&Creditcard=false' \
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', 'AgentAddAccount');
data.append('SessionId', '5dn35864tvqim0lt1t26vqg4l6');
data.append('Name', 'john');
data.append('Company', 'agentsanonymous');
data.append('Address', '28AgentStreet');
data.append('City', 'NewYork');
data.append('State', 'NY');
data.append('Zipcode', '10004');
data.append('Phone', '15555555555');
data.append('Email', 'john@example.onsip.com');
data.append('Username', 'example');
data.append('Domain', 'example.onsip.com');
data.append('Password', 'testing');
data.append('Productcode', 'onSIP');
data.append('Creditcard', 'false');

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
<Response xmlns="http://www.jnctn.net/ns/rest/2006-01">
  <Context>
    <Action>
      <IsCompleted>true</IsCompleted>
    </Action>
    <Request>
      <IsValid>true</IsValid>
      <DateTime>2014-04-21T13:42:11+00:00</DateTime>
      <Duration>814</Duration>
      <Parameters>
        <Parameter>
          <Name>Action</Name>
          <Value>AgentAddAccount</Value>
        </Parameter>
        <Parameter>
          <Name>SessionId</Name>
          <Value>5dn35864tvqim0lt1t26vqg4l6</Value>
        </Parameter>
        <Parameter>
          <Name>Username</Name>
          <Value>example</Value>
        </Parameter>
        <Parameter>
          <Name>Domain</Name>
          <Value>example.onsip.com</Value>
        </Parameter>
        <Parameter>
          <Name>Name</Name>
          <Value>john</Value>
        </Parameter>
        <Parameter>
          <Name>Company</Name>
          <Value>agentsanonymous</Value>
        </Parameter>
        <Parameter>
          <Name>Address</Name>
          <Value>28AgentStreet</Value>
        </Parameter>
        <Parameter>
          <Name>City</Name>
          <Value>Agent</Value>
        </Parameter>
        <Parameter>
          <Name>State</Name>
          <Value>NY</Value>
        </Parameter>
        <Parameter>
          <Name>Zipcode</Name>
          <Value>10004</Value>
        </Parameter>
        <Parameter>
          <Name>Phone</Name>
          <Value>15555555555</Value>
        </Parameter>
        <Parameter>
          <Name>Email</Name>
          <Value>john@example.onsip.com</Value>
        </Parameter>
        <Parameter>
          <Name>Password</Name>
          <Value>******</Value>
        </Parameter>
        <Parameter>
          <Name>Productcode</Name>
          <Value>onSIP</Value>
        </Parameter>
        <Parameter>
          <Name>Creditcard</Name>
          <Value>false</Value>
        </Parameter>
      </Parameters>
    </Request>
    <Session>
      <IsEstablished>true</IsEstablished>
      <SessionId>5dn35864tvqim0lt1t26vqg4l6</SessionId>
      <UserId>118652</UserId>
      <Roles>
        <Role>
          <Name>Agent Admin</Name>
        </Role>
      </Roles>
    </Session>
  </Context>
  <Result>
    <AgentAddAccount>
      <Account>
        <AccountId>28154</AccountId>
        <Receivable>0.00</Receivable>
        <Promocode/>
        <Productcode>onSIP</Productcode>
        <PerUserPricing>false</PerUserPricing>
        <BalanceSeconds>0</BalanceSeconds>
        <EscrowSecondsUpdate>0</EscrowSecondsUpdate>
        <EscrowSecondsCredit>0</EscrowSecondsCredit>
        <RegistrationLimit>0</RegistrationLimit>
        <Balance>0.0000000</Balance>
        <CreditLimit>0.00</CreditLimit>
        <Recharge>false</Recharge>
        <RechargeLevel>0.00</RechargeLevel>
        <RechargeThreshold>0.00</RechargeThreshold>
        <Modified>2014-04-21T13:42:11+00:00</Modified>
        <Created>2014-04-21T13:42:11+00:00</Created>
        <Contact>
          <Name>john</Name>
          <Organization>agentsanonymous</Organization>
          <Address>28AgentStreet</Address>
          <City>Agent</City>
          <State>NY</State>
          <Zipcode>10004</Zipcode>
          <Country>United States of America</Country>
          <CountryId>207</CountryId>
          <Phone>1-555-555-5555</Phone>
          <Email>john@example.onsip.com</Email>
          <Modified>2014-04-21T13:42:11+00:00</Modified>
        </Contact>
      </Account>
    </AgentAddAccount>
  </Result>
</Response>

Topics: Developer Docs