Developer APIs
GuidesProductUpdatesPricingFAQs
  • API Docs & Reference
  • REST API
    • Introduction
    • Agents
    • Chats
    • Offline Messages
    • Visitors
  • JavaScript API
    • Introduction
    • Chat Form
    • User Data & Logout Info Update
    • Chat Button
    • Click To Call Action
    • Language
    • Department
    • Event Listener
Powered by GitBook
On this page
  • Chat Script Insert
  • Audio/Video Call
  • Chat Window Launch upon Clicking A Link

Was this helpful?

  1. JavaScript API

Click To Call Action

Using Button API Developer can launch Pre-Chat form or offline message form on clicking any button or hyperlink of any website.

DEFINITION
$_REVECHAT_API(function(){ … });

Chat Script Insert

Insert the following chat script into website and replace your operator code/account id

 <script type='text/javascript'>
 window.$_REVECHAT_API || (function(d, w) { var r = $_REVECHAT_API = function(c) {r._.push(c);}; w.__revechat_account='YOUR_ACCOUNT_ID';w.__revechat_version=2;
   r._= []; var rc = d.createElement('script'); rc.type = 'text/javascript'; rc.async = true; rc.setAttribute('charset', 'utf-8');
   rc.src = ('https:' == document.location.protocol ? 'https://' : 'http://')+'static.revechat.com'+'/widget/scripts/new-livechat.js?'+new Date().getTime();
   var s = d.getElementsByTagName('script')[0]; s.parentNode.insertBefore(rc, s);
 })(document, window);
</script>

Audio/Video Call

Paste following code snippet into webpage

<a href='#' id='revechatCtCButton' onclick="$_REVECHAT_API['Button'] && $_REVECHAT_API.Button.startVoiceCall()"> <img style='height: 130px; width: 130px;' src='https://static.revechat.com/client/images/click-to-call-audio.png' data-toggle="modal" data-target="#exampleModal" data-whatever="@mdo" />
Paste following code snippet into webpage

<a href='#' id='revechatCtCButton' onclick="$_REVECHAT_API['Button'] && $_REVECHAT_API.Button.startVideoCall()"> <img style='height: 130px; width: 130px;' src='https://static.revechat.com/client/images/click-to-call-video.png' data-toggle="modal" data-target="#exampleModal" data-whatever="@mdo" />

Chat Window Launch upon Clicking A Link

DEFINITION
→ Insert chat script into website first
→ insert following html code into any section of your website
Paste following code snippet into webpage

<a href="javascript:void($_REVECHAT_API && $_REVECHAT_API['Button'] &&$_REVECHAT_API.Button.maximize())">chat with us</a>
PreviousChat ButtonNextLanguage

Last updated 1 year ago

Was this helpful?

Any questions? Please email us at

support@revechat.com