Miscellaneous Actions

Echo

An action which echoes all parameters back in the response.

Authentication & Authorization

Not required.

Request Parameters

None

Result Element Schema

Echo.rnc:

Echo.rng

Sample Request

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

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
<Response xmlns="http://www.jnctn.net/ns/rest/2006-01">
  <Context>
    <Action>
      <IsCompleted>true</IsCompleted>
    </Action>
    <Request>
      <IsValid>true</IsValid>
      <DateTime>2014-04-18T17:49:25+00:00</DateTime>
      <Duration>1</Duration>
      <Parameters>
        <Parameter>
          <Name>Action</Name>
          <Value>Echo</Value>
        </Parameter>
        <Parameter>
          <Name>Test</Name>
          <Value>test</Value>
        </Parameter>
      </Parameters>
    </Request>
    <Session>
      <IsEstablished>false</IsEstablished>
    </Session>
  </Context>
  <Result>
    <Echo/>
  </Result>
</Response>

Promocode Apply

Use a promotional code in the specified account. Account admins can apply these codes to their own accounts, while agent admins can apply them to any accounts for which they are the agents.

Authentication & Authorization

Authentication Authorization
Authorized Session Account Admin

Request Parameters

Required Parameters Description
Action “PromocodeApply”
Promocode The unique 16 character promotional code to be applied to this account.
AccountId A positive integer which references a unique account.

Result Element Schema

PromocodeApply.rnc:

PromocodeApply.rng

Sample Request

cURL
1
2
3
4
curl -X POST \
--data \
'Action=PromocodeApply&SessionId=ek5tglv89vd0j5f6hciu7qebo7&Promocode=TC19ZX5VN&AccountId=12042' \
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', 'PromocodeApply');
data.append('SessionId', 'ek5tglv89vd0j5f6hciu7qebo7');
data.append('Promocode', 'TC19ZX5VN');
data.append('AccountId', '12042');

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
<Response>
  <Context>
    <Action>
      <IsCompleted>true</IsCompleted>
    </Action>
    <Request>
      <IsValid>true</IsValid>
      <DateTime>2014-04-16T20:32:14+00:00</DateTime>
      <Duration>52</Duration>
      <Parameters>
        <Parameter>
          <Name>SessionId</Name>
          <Value>ek5tglv89vd0j5f6hciu7qebo7</Value>
        </Parameter>
        <Parameter>
          <Name>Action</Name>
          <Value>PromocodeApply</Value>
        </Parameter>
        <Parameter>
          <Name>Promocode</Name>
          <Value>TC19ZX5VN</Value>
        </Parameter>
        <Parameter>
          <Name>AccountId</Name>
          <Value>12042</Value>
        </Parameter>
      </Parameters>
    </Request>
    <Session>
      <IsEstablished>true</IsEstablished>
      <SessionId>ek5tglv89vd0j5f6hciu7qebo7</SessionId>
      <UserId>47927</UserId>
      <Roles>
        <Role>
          <Name>Super User</Name>
        </Role>
      </Roles>
    </Session>
  </Context>
  <Result>
    <PromocodeApply>
      <Account>
        <AccountId>12042</AccountId>
        <Receivable>0.00</Receivable>
        <Promocode>TC19ZX5VN</Promocode>
        <Productcode>onSIP</Productcode>
        <PerUserPricing>true</PerUserPricing>
        <BalanceSeconds>360000</BalanceSeconds>
        <EscrowSecondsUpdate>0</EscrowSecondsUpdate>
        <EscrowSecondsCredit>0</EscrowSecondsCredit>
        <RegistrationLimit>10</RegistrationLimit>
        <Balance>30.0000000</Balance>
        <CreditLimit>0.00</CreditLimit>
        <Recharge>true</Recharge>
        <RechargeLevel>20.00</RechargeLevel>
        <RechargeThreshold>5.00</RechargeThreshold>
        <Modified>2014-04-16T20:32:14+00:00</Modified>
        <Created>2011-05-31T18:47:39+00:00</Created>
        <Contact>
          <Name>Bob Jones</Name>
          <Organization>Junction Networks</Organization>
          <Address>55 Broad St</Address>
          <City>New York</City>
          <State>NY</State>
          <Zipcode>10004-2501</Zipcode>
          <Country>United States of America</Country>
          <CountryId>207</CountryId>
          <Phone>1-800-801-3381</Phone>
          <Email>bob@onsip.com</Email>
          <Modified>2014-03-07T17:20:34+00:00</Modified>
        </Contact>
      </Account>
    </PromocodeApply>
  </Result>
</Response>

NOOP

An action which does nothing.

Authentication & Authorization

Not required.

Request Parameters

Required Parameters Description
Action “NoOp”

Result Element Schema

NoOp.rnc:

NoOp.rng

Sample Request

cURL
1
2
3
4
curl -X POST \
--data \
'Action=NoOp' \
https://api.onsip.com/api
JavaScript
1
2
3
4
5
6
7
8
9
var data = new FormData();
data.append('Action', 'NoOp');

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
<Response xmlns="http://www.jnctn.net/ns/rest/2006-01">
  <Context>
    <Action>
      <IsCompleted>true</IsCompleted>
    </Action>
    <Request>
      <IsValid>true</IsValid>
      <DateTime>2014-04-18T17:49:25+00:00</DateTime>
      <Duration>0</Duration>
      <Parameters>
        <Parameter>
          <Name>Action</Name>
          <Value>NoOp</Value>
        </Parameter>
    </Request>
    <Session>
      <IsEstablished>false</IsEstablished>
    </Session>
  </Context>
  <Result>
    <NoOp/>
  </Result>
</Response>

Topics: Developer Docs