DChat API Reference

Before You Begin

Legacy Web Forms reference. This page documents the older ChatApi.asmx integration and API demo. It does not describe the REST API in the current .NET 8 package. For a new integration, start with the current server package and its API endpoints.

If you maintain a Web Forms deployment, install its API demo site and main DChat application first to validate ChatApiKey and ChatApiNotificationUrl.

The examples below use chat.example.com for the main DChat deployment and api-demo.example.com for the API demo site. Replace those placeholders with your own domains.

The DChat API reference covers two main areas.

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

Consuming a Web Service from DChat APP Server

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 DChat.*/
  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 DChat.*/
  int SessionId   { get; set; }      /* Gets or sets the session ID of the chat.*/
}

Creating a ChatMsgData Object

ChatMsgData class is used to store information about a chat message.

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.*/
}
Self-hosted customer support software

Deploy live chat on your own terms, not on someone else's pricing model.

DChat gives you the installable server, web dashboard, website widget, and desktop agent tools in one self-hosted product, with live chat free to run, and an AI agent that answers, acts with the approvals you set and hands off to your team when you want one. Run it on infrastructure you trust, on the model you choose.

Deployment

Install on Windows or Linux, behind IIS or Nginx, in a VM, or in Docker if that fits your stack.

Commercial model

Live chat is free with unlimited agents. Premium, with the AI agent, is billed per agent per month, never per conversation.

AI Flexibility

Run the AI agent on a local Ollama model, or connect OpenAI and Anthropic with your own provider accounts.