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

Was this helpful?

  1. JavaScript API

Introduction

There are 3 types of API available for visitor chat window. Following are the available API.

  • API for Chat form

  • API for Chat Button

  • API for Language

Basic API Usage

API Usage Example. i.e set name for visitor

DEFINITION
$_REVECHAT_API(function(){ … });
<script type="text/javascript"> 
	window.$_REVECHAT_API || (function(d, w) 
	{ 
		var r = $_REVECHAT_API = function(c) {r._.push(c);}; w.__revechat_account="3577764";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);

	$_REVECHAT_API(function()
	{
		$_REVECHAT_API.Form.Online.setName(“john”);

	});
</script>
PreviousVisitorsNextChat Form

Last updated 2 years ago

Was this helpful?

Any questions? Please email us at

support@revechat.com