Module available through NPM and can be installed with command npm install livechatapi
Module designed to completely repeat official API without needs to think about authentication.
var LiveChatApi = require('livechatapi').LiveChatApi;
var api = new LiveChatApi('[email protected]', 'APIKEY')
api.status.get({ group: 0 }, function(data){
console.log(data);
});
If you need to call function with default parameters you can call it without parameters
. Above function could be simplified to
api.status.get(function(data){
console.log(data);
});
If you don't need function results you can skip callback
function definition. For example new agent creation can be done with this code
api.agents.create({ login: '[email protected]', name: 'Philip J. Fry' })
Full description of methods parameters available at LiveChat RESTful API Documentation page.
Library has API V1 support but as this version is deprecated it's not described in list. Most part of functions calls are similar to V2. For example, list of operators could be asked with simple api.operators.list() call.
Returns all LiveChat agents list.
Return complete details of the agent for the given login.
Creates a new agent in your license.
Updates the specified agent by setting the values of the parameters passed. Any parameters not provided will be left unchanged.
Reset API key for the agent with given login.
Removes an agent. Archived chats will not be removed, but all statistics will be lost. Agent will be notified by e-mail that the account has been deleted.
Returns list of all currently set canned responses.
Get single canned response. id
is obtained from the all canned responses list.
Creates a new canned response.
Updates the specified canned response by setting the values of the parameters passed. Any parameters not provided will be left unchanged.
Removes a canned response with the given id
.
Returns all ended chats.
Returns single chat item for the given id
.
Send chat transcript to e-mail.
Returns all currently set goals.
Returns goal details for the given id
.
Creates new goal.
Updates the specified goal by setting the values of the parameters passed. Any parameters not provided will be left unchanged.
Removes a goal with the given id
.
Mark goal as successful.
Returns all created groups.
Returns group details for the given id
.
Creates a new group in your license.
Updates the specified group by setting the values of the parameters passed. Any parameters not provided will be left unchanged.
Removes a group with the given id
.
Returns statistics overview from last 7 days for the whole license.
Returns statistics overview from last 7 days for the specified agent. Shows his ratings, number of chats and number of reached goals. login
must be correct e-mail address.
Returns statistics overview from last 7 days for the specified group. Shows ratings, number of chats and reached goals. id
is obtained from all groups list.
Shows how many chats and missed chats (offline messages) occurred during the specified period.
Shows how many chats were rated and how they have been rated during specified period.
Shows the ratio of good to bad ratings for each operator.
Shows how many visitors were waiting in the queue, how many abandoned the queue or proceeded to chats.
Shows Minimum, Average and Maximum waiting time.
Shows how much the agent (or group or whole account) was available for chatting during specified period. When querying for one day results are shown in minutes per every hour, otherwise in hours for each day.
Shows how much time the agent (or group) spent on chatting during specified period. When querying for one day results are shown in minutes per every hour, otherwise in hours for each day.
Shows the number of reached goals.
Returns current LiveChat status.
Returns list of the visitors available on pages with tracking code installed.
Returns list of currently chatting visitors.
Displays additional information about the visitor in LiveChat apps. Detailed explaination available on API documentation page.