API Reference

Before You Begin

  • Please install ZChat API demo site and ZChat Web site on your server so that you can be familiar with configuring ChatApiKey and ChatApiNotificationUrl.
  • The following guide assumes that you're deploying ZChat Web Site at zchatdemo.com and API Demo Site at zchatAPIdemo.com.

ZChat API is split up two different areas.

  • Consume a web service from ZChat Web site.
  • Submit new Cases or Notes attached to Leads, including detailed debug information.

The code example is written in C#. However you can call ZChat API web service and consume it from any other programming language(PHP,JAVA,RUBY,node.js).

Consuming a Web Service from ZChat Web site

Creating a ChatApiAgent Object

ChatApiAgent class is used to store information about a chat agent who works for an organization.


class ChatApiAgent
{
  bool Disabled { get; set; }         /* Determines whether the agent account is disabled*/
  string DisplayName { get; set; }    /* A friendly name that can be displayed to users. */
  string Email { get; set; }          /* Gets or sets the e-mail address of the agent.*/
  bool IsAdmin { get; set; }          /* Determines whether the user is a member of the Administrators group.*/
  string LoginName { get; set; }      /* Gets or sets the agent's logon name.*/
  string Password { get; set; }       /* Gets or sets the agent's password.*/
  int UserId { get; set; }            /* Gets or sets the user ID of the agent. */
}

Creating a ChatApiDepartment Object

ChatApiDepartment class is used to store information about a department.


class ChatApiDepartment
{
  ChatApiAgent[] Agents { get; set; }   /* Gets all agents of the department.*/
  int DepartmentId { get; set; }        /* Gets or sets the department's ID. */
  string Description  { get; set; }     /* Gets or sets the department's description.*/
  string Name  { get; set; }            /* Gets or sets the department's name.*/
}

Creating a SupportSession Object

SupportSession class is used to store information about a single conversation.


class SupportSession
{
  DateTime ActiveTime { get; set; }  /* The last active time of the chat room. */
  int AgentRating { get; set; }      /* Gets or sets the agent's rating score received from the visitor. */
  string AgentUserId  { get; set; }  /* Gets or sets the agent's UserId(eg User:3).*/
  DateTime BeginTime { get; set; }   /* The last active time of the chat room. */
  string Browser { get; set; }       /* Gets or sets the visitor's browser details.*/
  string ContextData { get; set; }   /* Gets or sets the contextual data of ZChat.*/
  string Culture { get; set; }       /* Gets or sets the visitor's browser language preference.*/
  string CustomData { get; set; }    /* Gets or sets the custom data.*/
  /* Gets or sets the visitor's Chat ID(eg Guest:@userkey or Guest:xxxxxxxx-xxxx-xxxx-xxxx-xxxx).*/
  string CustomerId { get; set; }
  int DepartmentId  { get; set; }    /* Gets or sets the department's ID selected by the visitor.*/
  string DisplayName { get; set; }   /* Gets or sets the user name input by the visitor.*/
  string Email { get; set; }         /* Gets or sets the e-mail address input by the visitor.*/
  string Question  { get; set; }     /* Gets or sets the question input by the visitor.*/
  string IPAddress  { get; set; }    /* Gets or sets the IP Address of the visitor.*/
  string OAuthInfo  { get; set; }    /* Gets or sets the custom data.*/
  string OAuthKey  { get; set; }     /* Gets or sets the custom data.*/
  string PageTitle  { get; set; }    /* Gets or sets the page title where a visitor initiates a chat.*/
  string PageUrl  { get; set; }      /* Gets or sets the page url where a visitor initiates a chat.*/
  string Platform  { get; set; }     /* Gets or sets the visitor's operating system info.*/
  string ProductKey  { get; set; }   /* Gets or sets the ProductKey which is set using Javascript API.*/
  string ProductName  { get; set; }  /* Gets or sets the ProductName which is set using Javascript API.*/
  string Referrer   { get; set; }    /* Gets or sets the referrer URL where the visitor has arrived to the page.*/
  string SessionData   { get; set; } /* Gets or sets the session data of ZChat.*/
  int SessionId   { get; set; }      /* Gets or sets the session ID of the chat.*/
}

Creating a ChatMsgData Object

ChatApiDepartment class is used to store information about a department.


class ChatApiDepartment
{
  string Html  { get; set; }     /* Gets or sets the department's description.*/
  int MessageId { get; set; }    /* Gets or sets the department's ID. */
  string Sender { get; set; }    /* Gets or sets the department's description.*/
  string SenderId  { get; set; } /* Gets or sets the department's description.*/
  int SessionId { get; set; }    /* Gets or sets the department's ID. */
  string Text  { get; set; }     /* Gets or sets the department's name.*/
  DateTime  Time { get; set; }   /* Gets or sets the department's name.*/
}

ON-PREMISE LIVE CHAT

ZChat Enterprise offers an on-premises Live Chat Solution. Protect customer data and other proprietary information by ensuring it never leaves your data-center.

Let's get started

Your customers are already on your site. Chat with your visitors, Increase sales and conversions, make your customers happy!

Start your 30 day free trial

Need ZChat Cloud?

ZChat is offered as a deployable product, that you can install and manage on your own server.
If, however, you favour a hosted chat solution and wish to take advantage of a cloud-based live chat, then we invite you to consider MyLiveChat.
MyLiveChat is built on the same technology as ZChat, but delivered as a hosted solution, with a variety of monthly subscription plans.


Read More

ZChat helps you make happy customers