RPC documentation

From LIVECHAT Developer Zone Wiki

Jump to: navigation, search

Short summary

Server provides functionality to signal predefined events using the RPC (Remote Procedure Call). Events are signaled using popular HTTP protocol. To make this feature to work you should take following steps:

  • Set up proper parameters in lc_serv.cfg file (LIVECHAT server side)
  • Create scripts that employ LIVECHAT events (HTTP server side)

Server side configuration

To make the RPC working you should define at least one of EVENT parameters in lc_serv.cfg. After setting up parameters you should restart the server.

Parameters:

  • EVENT_NEW_LICENCE – URL address which is requested when a new licence was created (HTTP request is performed on server defined in RPC_SERVER_IP)
  • EVENT_NEW_OPERATOR - URL address which is requested when new operator has been created
  • EVENT_LICENCE_INFO - URL address which is requested when licence info has been changed (including server starting and initializing licence information)
  • EVENT_NEW_OPERATOR_SUBSCRIPTION - URL address which is requested when new operator's subscription has been created
  • EVENT_OPERATOR_TRANSFER – URL address which is requested when a client is transfered by an agent
  • EVENT_OPERATOR_STATUS - URL address which is requested when an agent changes its status
  • EVENT_BUTTON_STATUS - URL address which is requested when button(s) on a web page changes its state
  • EVENT_CHAT_STARTED - URL address which is requested when a new chat is started
  • EVENT_PRIVATE_CHAT_STATUS - URL address which is requested when a chat status is changed
  • EVENT_CLIENT_INVITED - URL address which is requested when a client is invited to a chat
  • EVENT_OPERATOR_STOPED_CHAT - URL address which is requested when an agent stops a chat
  • EVENT_VISITOR_LEFT_CHAT - URL address which is requested when a visitor lefts a chat


Sample lc_serv.cfg file:

EVENT_NEW_LICENCE http://labs.livechatinc.com/event_new_licence.pl
EVENT_OPERATOR_TRANSFER http://labs.livechatinc.com/events.pl
EVENT_OPERATOR_STATUS http://labs.livechatinc.com/events.pl
EVENT_BUTTON_STATUS http://labs.livechatinc.com/events.pl

HTTP server side configuration

HTTP server will receive one or more events (depends on lc_serv.cfg file) defined as:

  • EVENT_NEW_LICENCE – a new licence and a first agent was created, available parameters:
    • EVENT - equal to NEW_LICENCE (as one script may deploy more than one events)
    • LICENCE - LIVECHAT licence number
    • PASSWORD - an agent's password
    • NICK - an agent's nick
    • LAST_NAME - an agent's last name
    • FIRST_NAME - an agent's first name
    • OPERATOR_ID - an agent's LIVECHAT ID (e-mail)
    • PHONE - an agent's phone number
    • LIC_TYPE - type of licence (numerical ID of licence type (1 - ASP-FULL, 9 - ASP-DEMO)
    • WEB_PAGE - web page
    • PROMO_CODE - a promotion code
    • ACCOUNT_TYPE - type of operator account (communicator, contact center)
    • EXPIRATION_DATE - date and time of licence expiration
    • LANGUAGE - language of created licence
  • EVENT_NEW_OPERATOR - a new operator was created
    • EVENT - equal to NEW_OPERATOR
    • LICENCE - LIVECHAT licence number
    • PASSWORD - an angent's password
    • LAST_NAME - an agent's last name
    • FIRST_NAME - an agent's first name
    • OPERATOR_ID - an agent's LIVECHAT ID (e-mail)
    • ACCOUNT_TYPE - type of operator account (communicator, contact center)
  • EVENT_LICENCE_INFO - licence info changed
    • EVENT - equal to LICENCE_INFO
    • LICENCE - LIVECHAT licence number
    • EXPIRATION_DATE - date and time of licence expiration
    • LIC_TYPE - type of licence (numerical ID of licence type (1 - ASP-FULL, 9 - ASP-DEMO)
  • EVENT_NEW_OPERATOR_SUBSCRIPTION - licence info changed
    • EVENT - equal to NEW_OPERATOR_SUBSCRIPTION
    • LICENCE - LIVECHAT licence number
    • OPERATORS_COUNT_CC - communicator operators count
    • OPERATORS_COUNT_COM - contact center operators count
    • START_DATE - subscription start date and time
    • END_DATE - subscription end date and time
    • PAYMENT_METHOD - payment method id
    • NET_PRICE - net price of subscription
    • VAT - vat
  • EVENT_OPERATOR_TRANSFER – a client is transfered by an agent, available parameters:
    • EVENT - equal to OPERATOR_TRANSFER (as one script may deploy more than one events)
    • LICENCE - LIVECHAT licence number
    • CLIENT_ID - transferred client ID
    • NEW_OPERATOR_ID - an new agent's LIVECHAT ID (e-mail)
    • OPERATOR_ID - LIVECHAT ID (e-mail) of an agent that perform a transfer
    • STATUS - a status of an agent that performs a transfer
      • 0 = STATUS_ONLINE
      • 1 = STATUS_AWAY
      • 2 = STATUS_OFFLINE
      • 3 = STATUS_TEXT_AVAILABLE
      • 4 = STATUS_VOICE_AVAILABLE
      • 5 = STATUS_INVISIBLE
  • EVENT_OPERATOR_STATUS - an agent changes its status, available parameters:
    • EVENT - equal to OPERATOR_STATUS (as one script may deploy more than one events)
    • LICENCE - LIVECHAT licence number
    • OPERATOR_ID - LIVECHAT ID (e-mail) of an agent
    • STATUS - a status of an agent
      • 0 = STATUS_ONLINE
      • 1 = STATUS_AWAY
      • 2 = STATUS_OFFLINE
      • 3 = STATUS_TEXT_AVAILABLE
      • 4 = STATUS_VOICE_AVAILABLE
      • 5 = STATUS_INVISIBLE
  • EVENT_BUTTON_STATUS - button(s) on a web page changes its state, available parameters:
    • EVENT - equal to BUTTON_STATUS (as one script may deploy more than one events)
    • LICENCE - LIVECHAT licence number
    • STATUS - equal "online" or "offline"
  • EVENT_CHAT_STARTED - a new chat is started, available parameters:
    • EVENT - equal to CHAT_STARTED (as one script may deploy more than one events)
    • LICENCE - LIVECHAT licence number
    • CLIENT_ID - ID of client that started a chat
    • INVITING_OP - LIVECHAT ID of an agent which sent an invitation to a client (optional)
    • OPERATOR_ID - LIVECHAT ID (e-mail) of an agent
    • STATUS - a status of an agent
      • 0 = STATUS_ONLINE
      • 1 = STATUS_AWAY
      • 2 = STATUS_OFFLINE
      • 3 = STATUS_TEXT_AVAILABLE
      • 4 = STATUS_VOICE_AVAILABLE
      • 5 = STATUS_INVISIBLE
  • EVENT_PRIVATE_CHAT_STATUS - a chat status is changed, available parameters:
    • EVENT - equal to PRIVATE_CHAT_STATUS (as one script may deploy more than one events)
    • LICENCE - LIVECHAT licence number
    • OPERATOR_ID - LIVECHAT ID (e-mail) of an agent that changed a status of a chat
    • STATUS - "start" or "stop" of a private chat
    • GROUP - LIVECHAT conference number
  • EVENT_CLIENT_INVITED - a client is invited to a chat, available parameters:
    • EVENT - equal to CLIENT_INVITED (as one script may deploy more than one events)
    • LICENCE - LIVECHAT licence number
    • OPERATOR_ID - LIVECHAT ID (e-mail) of an agent which sent an invitation to a client
    • CLIENT_ID - ID of client that was invited to a chat
  • EVENT_OPERATOR_STOPED_CHAT - an agent stops a chat, available parameters:
    • EVENT - equal to OPERATOR_STOPED_CHAT (as one script may deploy more than one events)
    • LICENCE - LIVECHAT licence number
    • OPERATOR_ID - LIVECHAT ID (e-mail) of an agent which stopped a chat
    • CLIENT_ID - Client ID of the client that was the chat with
    • GROUP - LIVECHAT conference number
    • CHAT - url encoded chat content
  • EVENT_VISITOR_LEFT_CHAT - a visitor lefts a chat, available parameters:
    • EVENT - equal to VISITOR_LEFT_CHAT (as one script may deploy more than one events)
    • LICENCE - LIVECHAT licence number
    • OPERATOR_ID - LIVECHAT ID (e-mail) of an agent which was the chat with
    • CLIENT_ID - Client ID of the client that was the chat with
    • GROUP - LIVECHAT conference number
    • CHAT - url encoded chat content
Personal tools