InstaCall

OnSIP InstaCall buttons enable website visitors to instantly communicate with OnSIP users or other destination addresses. To learn more about OnSIP InstaCalls, refer to this series of InstaCall guides.

Instacall Generate

Generate an InstaCall button.

Authentication & Authorization

AuthenticationAuthorization
Authenticated Session Account Admin

Request Parameters

Required ParametersDescription
Action “InstacallGenerate”
SessionId Authenticated Session identifier.
OrganizationId A positive integer which references a unique Organization.
InstacallName A unique identifier for the InstaCall. This must not match any saved InstaCall configurations.
CallDestination A SIP address to call. When website visitors click the InstaCall button, this is the SIP address that will be invited into a voice or video session.
Optional ParametersDefaultDescription
Instructions Start your call with us. This message is presented to the user when the InstaCall window opens (after clicking the InstaCall button).
VideoEnabled true If video is enabled, the user is presented with the option of calling with video or just audio. If video is not enabled, a single ‘Connect’ button is displayed.
DtmfEnabled true If DTMF is enabled, the user will have access to a number pad during the call. DTMF can be used to navigate Attendant Menus and other applications.
CallerId “instacall-name” The CallerId option controls how the InstaCall determines the displayed name of the caller. Valid options for CallerId are “instacall-name”, “caller-name”, and “caller-name-tag”. “instacall-name” uses the InstacallName parameter. “caller-name” prompts the user for their name before placing the call. “caller-name-tag” prompts the user for their name before placing the call, prefixing it with the CallerIdTag, if any.
CallerIdTag {empty} Up to three characters to display before the user’s name. This parameter has no effect if CallerId is not “caller-name-tag”.
Theme flat-light CSS theme for the InstaCall button and window. Valid options are “flat-light”, “flat-dark”, “skeu-light”, and “skeu-dark”.
ButtonText altPhone or “Click to Call” The text to display in the InstaCall button. If not set, the button text will default to the alternate phone number. If no alternate phone number is configured, the text will default to “Click to Call”.
AnalyticsWebPropertyId {empty} The Google Analytics Property ID to use for InstaCall analytics events.
AnalyticsDomainName {empty} The Google Analytics domain name to use for InstaCall analytics events.
AltEmail {empty} An alternate contact email, to be displayed after the call or in case of error.
AltPhone {empty} An alternate phone number, to be dipslayed after the call or in case of error. The alternate phone number may also be displayed as the ButtonText if no button text is configured.
AltWebsite {empty} An alternate contact URL, to be displayed after the call or in case of error.
PostCallMessage “Thank you for getting in touch with us!” A message to display to the user after each session ends.
FromURI anonymous.123456@anonymous.invalid The SIP address from which to invite. This should be an address in your OnSIP domain. If no address is specified, an anonymous address is generated. See Authentication and Instacall for more information on choosing a From URI.
RemoveLogo false If enabled, RemoveLogo hides the bottom bar from the InstaCall window, including the OnSIP logo.
Bhr0open, Bhr0close Always Open The time range to enable the button on Sundays. Valid times should be formatted as “HHMM” strings using 24-hour time (ie, 9:30 AM = “0930”, 11:00PM = “2300”)
Bhr1open, Bhr1close Always Open The time range to enable the button on Mondays.
Bhr2open, Bhr2close Always Open The time range to enable the button on Tuesdays.
Bhr3open, Bhr3close Always Open The time range to enable the button on Wednesdays.
Bhr4open, Bhr4close Always Open The time range to enable the button on Thursdays.
Bhr5open, Bhr5close Always Open The time range to enable the button on Fridays.
Bhr6open, Bhr6close Always Open The time range to enable the button on Saturdays.
TimeZone 0 The hour offset used for business hour rules. Valid TimeZone options are between -12 and 14, inclusive.

Result Element Schema

InstacallGenerate.rnc:

InstacallGenerate.rng

Sample Request

cURL
1
2
3
curl -X POST \
--data \ 'Action=InstacallGenerate&InstacallName=ExampleOne&OrganizationId=12345&CallDestination=john.doe%40example.onsip.com&CallerId=caller-name&ButtonText=Click to Call John Doe' \
https://api.onsip.com/api
JavaScript
1
2
3
4
5
6
7
8
9
10
11
12
13
14
var data = new FormData();
data.append('Action', 'InstacallGenerate');
data.append('InstacallName', 'ExampleOne');
data.append('OrganizationId', '12345');
data.append('CallDestination', 'john.doe@example.onsip.com');
data.append('CallerId', 'caller-name');
data.append('ButtonText', 'Click to Call John Doe');

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
<?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>2014-04-16T16:04:27+00:00</DateTime>
      <Duration>50</Duration>
      <Parameters>
        <Parameter>
          <Name>Action</Name>
          <Value>InstacallGenerate</Value>
        </Parameter>
        <Parameter>
          <Name>InstacallName</Name>
          <Value>ExampleOne</Value>
        </Parameter>
        <Parameter>
          <Name>OrganizationId</Name>
          <Value>12345</Value>
        </Parameter>
        <Parameter>
          <Name>CallDestination</Name>
          <Value>john.doe@example.onsip.com</Value>
        </Parameter>
        <Parameter>
          <Name>CallerId</Name>
          <Value>caller-name</Value>
        </Parameter>
        <Parameter>
          <Name>ButtonText</Name>
          <Value>Click to Call John Doe</Value>
        </Parameter>
        <Parameter>
          <Name>VideoEnabled</Name>
          <Value>true</Value>
        </Parameter>
        <Parameter>
          <Name>DtmfEnabled</Name>
          <Value>true</Value>
        </Parameter>
        <Parameter>
          <Name>RemoveLogo</Name>
          <Value>false</Value>
        </Parameter>
        <Parameter>
          <Name>Theme</Name>
          <Value>flat-light</Value>
        </Parameter>
      </Parameters>
    </Request>
    <Session>
      <Stateless>true</Stateless>
      <IsEstablished>true</IsEstablished>
      <SessionId>9921c554c48ba60417a8dac8edbbe611</SessionId>
      <UserId>54321</UserId>
      <Roles>
        <Role>
          <Name>Account Admin</Name>
        </Role>
      </Roles>
    </Session>
  </Context>
  <Result>
    <InstacallGenerate>
      <Instacall>
        <InstacallId/>
        <InstacallName>ExampleOne</InstacallName>
        <Instructions>Start your call with us.</Instructions>
        <CallDestination>john.doe@example.onsip.com</CallDestination>
        <Theme>flat-light</Theme>
        <VideoEnabled>true</VideoEnabled>
        <DtmfEnabled>true</DtmfEnabled>
        <RemoveLogo>false</RemoveLogo>
        <CallerId>caller-name</CallerId>
        <CallerIdTag/>
        <ButtonText>Click to Call John Doe</ButtonText>
        <AnalyticsWebPropertyId/>
        <AnalyticsDomainName/>
        <AltPhone/>
        <AltEmail/>
        <AltWebsite/>
        <bhr0open/>
        <bhr1open/>
        <bhr2open/>
        <bhr3open/>
        <bhr4open/>
        <bhr5open/>
        <bhr6open/>
        <bhr0close/>
        <bhr1close/>
        <bhr2close/>
        <bhr3close/>
        <bhr4close/>
        <bhr5close/>
        <bhr6close/>
        <TimeZone/>
        <PostCallMessage/>
        <FromURI/>
        <ButtonCode>&lt;button class=&quot;ic-button&quot; data-instaCallName=&quot;ExampleOne&quot; data-Instructions=&quot;Start your call with us.&quot; data-address=&quot;john.doe@example.onsip.com&quot; data-video=&quot;true&quot; data-dtmf=&quot;true&quot; data-callerId=&quot;caller-name&quot; data-callerIdTag=&quot;&quot; data-theme=&quot;flat-light&quot; data-analyticsWebPropertyId=&quot;&quot; data-analyticsDomainName=&quot;&quot; data-altPhone=&quot;&quot; data-altEmail=&quot;&quot; data-altWebsite=&quot;&quot; data-postmessage=&quot;&quot; title=&quot;To make a web call, please enable Javascript for your browser.&quot; disabled=&quot;disabled&quot;&gt;Click to Call John Doe&lt;/button&gt;&lt;script src=&quot;https://insta.onsip.com/call/js/popup.js&quot;&gt;&lt;/script&gt;</ButtonCode>
      </Instacall>
    </InstacallGenerate>
  </Result>
</Response>

Learn More

To learn more about customizing InstaCall buttons, see our guide on customizing your WebRTC button app.

Topics: Developer Docs