Skip to end of metadata
Go to start of metadata

The Callback API is used for receiving events and controlling the callback widget on your website.

(warning) Mail for your questions: support@onlinepbx.ru.


 

Connection and setup

<script type="text/javascript" src="https://callback.onlinepbx.ru/loader.js" charset="UTF-8" data-onpbxcb-id="ID WIDGET"></script>

Data attributes

AttributeNoteDescription
data-onpbxcb-idmandatoryWidget ID
data-dest 

Destination number (the call will be made from a different number on this page)

Example:

data-onpbxcb-id = Widget ID
data-dest = Destination number

(warning) Widget ID is located in the callback widget code, on the settings page onlinePBX.


 

Controlling the widget

ObjectDescription
OnlinePBXWebWidget.expand()Force widget to expand, displaying number input form
OnlinePBXWebWidget.collapse()Force widget to collapse deploы widget
OnlinePBXWebWidget.disable()Hide and disable widget
OnlinePBXWebWidget.destroy()Remove widget code from page

To contents


 

Widget events

(warning) Located after loader:

<script type="text/javascript">
Initialization
if (typeof OnlinePBXWebWidget == 'undefined')
OnlinePBXWebWidget = {events:{}};
Triggered when widget completes initialization
OnlinePBXWebWidget.events.init = function() {
};
Triggered when user clicks button
OnlinePBXWebWidget.events.expandclick = function() {
};
Triggered when form deploys
OnlinePBXWebWidget.events.expandauto = function() {
};
Triggered when user clicks the cross in the upper right corner of window

@param {String} src - source (hunter - automatically opens form when clicked)

OnlinePBXWebWidget.events.disableclick = function(src) {
};

Triggered when user has entered number in form and clicks “receive call”
@param {String} number
@param {String} src - source (hunter - automatically opens form when clicked

 OnlinePBXWebWidget.events.callrequest = function(number, src) {

// yaCounter123456.reachGoal('goalname');
};

Triggered by successful call
@param {String} number
@param {String} op - name of operator
@param {String} src - source (hunter - automatically opens form when clicked)

  OnlinePBXWebWidget.events.callsuccess = function(number, op, src) {

};

Triggered if user has requested a call, but we are unable to make it.
@param {String} number
@param {String} error - text of error message
@param {String} src - source (hunter - automatically opens form when clicked)

OnlinePBXWebWidget.events.callfail = function(number, error, src) {
};
</script>

To contents

Write a comment…