Skip to content

Willardgmoore/livechat_client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LiveChat API Ruby Client

Connection

Basic Auth over HTTPS is used to authenticate API requests.

require "livechat"

@livechat = LiveChat::Client.new do |config|
  config.login = "[email protected]"
  config.api_key = ""
end

List all agents

@livechat.agents.fetch                    # all agents
@livechat.agents.each {|user| ..code.. }  # iterate over requested agents

Get a single agent details

@livechat.agents('[email protected]')

Create a new agent

@livechat.agents.create do |a|
  a[:login] = @alice_id
  a[:name] = 'Alice'
end

Update an agent

@livechat.agents(@jane_id).update do |a|
  a[:job_title] = 'Tester'
  a[:status] = 'not accepting chats'
end

Reset an API key

  @livechat.agents('[email protected]').reset_api_key

Remove an agent

  @livechat.agents('[email protected]').delete

List all canned responses

  @livechat.canned_responses

Get a single canned response

  @livechat.canned_responses(3151)

Create a new canned response

  @livechat.canned_responses.create do |r|
    r[:text] = 'Have a great day, goodbye.'
    r[:tags] = ['cu', 'bye']
  end

Update a canned response

  @livechat.canned_responses(3151).update do |r|
    r[:tags] = ['bye']
  end

Remove a canned response

  @livechat.canned_responses(3151).delete

Get list of chats

Get single chat

Send chat transcript to e-mail

List all goals

Get a single goal details

Mark goal as successful

Add a new goal

Update a goal

Remove a goal

List all groups

Get a single group details

Create a new group

Update a group

Remove a group

Get dashboard data

  @livechat.reports.dashboard

Get dashboard data for agent

  @livechat.reports.dashboard(:agent => '[email protected]')

Get dashboard data for group

  @livechat.reports.dashboard(:group => 1)

Get chats report

  @livechat.reports.chats(:date_from => '2013-01-01')

Get ratings report

  @livechat.reports.ratings(:group => 1)

Get ratings ranking

  @livechat.reports.ratings_ranking(:group => 1)

Get queued visitors report

  @livechat.reports.queued_visitors(:date_from => '2013-01-01')

Get queue waiting times report

  @livechat.reports.queued_visitors_waiting_times(:date_from => '2013-01-01')

Get availability report

  @livechat.reports.availability

Get chatting time report

  @livechat.reports.chatting_time

Get goals report

  @livechat.reports.goals

Get status

List all visitors

List only chatting visitors

Add custom visitor details

Contributing

Ways you can help:

  • report bugs
  • writing/fixing documentation
  • writing specifications (provide suggestions for API v2)
  • writing code (refactoring, strengthening areas that are weak, catching typos)

Note on Patches/Pull Requests

  • Fork the project.
  • Make your feature addition or bug fix.
  • Add tests for it. This is important so we don't break it in a future version unintentionally.
  • Commit
  • Send a pull request. Bonus points for topic branches.

MIT License

Copyright (c) 2013 LiveChat Inc

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

About

A Ruby client for the Livechat REST API

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Ruby 100.0%