Call Setup

AuthCallSetup

Allows you to place calls between two users that you are authorized to place calls for. The user "placing the call" will be rung first, then once they pickup the user/destination being called will be rung.

Authentication & Authorization

Authentication Authorization
Authenticated Session Standard User

Request Parameters

Required Parameters Description
Action “AuthCallSetup”
SessionId Authenticated Session identifier.
FromAddress  The user who the call will be from. Users only have permission to initiate calls from themselves, admins can initiate from users they administrate. This user's endpoints will begin ringing immediately.
ToAddress  The person who is being called. Once the FromAddress user picks up, this person will be called. PSTN numbers can also be called, using format "<11 digit number>@jnctn.net"

Sample Request

cURL
1
2
3
4
curl -X POST \
--data \
'Action=AuthCallSetup&SessionId=iusj9dslgivu5vqsm28qq330k6&FromAddress=james@example.onsip.com&ToAddress=john@example.onsip.com' \
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', 'AuthCallSetup');
data.append('SessionId', 'iusj9dslgivu5vqsm28qq330k6');
data.append('FromAddress', 'james@example.onsip.com');
data.append('ToAddress', 'john@example.onsip.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
<Response xmlns="http://www.jnctn.net/ns/rest/2006-01">
   <Context>
      <Action>
         <IsCompleted>true</IsCompleted>
      </Action>
      <Request>
         <IsValid>true</IsValid>
         <DateTime>2017-01-17T14:50:41+00:00</DateTime>
         <Duration>24</Duration>
         <Parameters>
            <Parameter>
               <Name>Action</Name>
               <Value>AuthCallSetup</Value>
            </Parameter>
            <Parameter>
               <Name>SessionId</Name>
               <Value>j70lnm279slqjvlfe8al5ecs22</Value>
            </Parameter>
            <Parameter>
               <Name>FromAddress</Name>
               <Value>james@example.onsip.com</Value>
            </Parameter>
            <Parameter>
               <Name>ToAddress</Name>
               <Value>john@example.onsip.com</Value>
            </Parameter>
         </Parameters>
      </Request>
      <Session>
         <IsEstablished>true</IsEstablished>
         <SessionId>j70lnm279slqjvlfe8al5ecs22</SessionId>
         <UserId>152258</UserId>
         <Roles>
            <Role>
               <Name>User</Name>
            </Role>
         </Roles>
      </Session>
   </Context>
   <Result>
      <AuthCallSetup>
         <FinalResponse>
            <Code>200</Code>
            <Reason>OK</Reason>
         </FinalResponse>
      </AuthCallSetup>
   </Result>
</Response>

Topics: Developer Docs