Giter VIP home page Giter VIP logo

api-client-php's Introduction

LiveChat API Client

PHP client for connecting to the LiveChat REST API.

Documentation

To find out more, visit the official LiveChat REST API documentation.

Previous version of LiveChat API Client.

Requirements

  • PHP 5.3 or greater
  • cUrl extension enabled

Authentication to the API occurs via HTTP Basic Auth. Provide your:

  • login
  • API key

More information: https://developers.livechatinc.com/rest-api/#authentication

Installation

Composer

$ composer require livechat/api-client-php "@dev"

Or, set up dev as minimum-stability in your composer.json:

    "minimum-stability": "dev"

Then:

 $ composer require livechat/api-client-php
 $ composer update

Execute tests

This operation requires PHPUnit installed.

 $ phpunit

Basic usage

<?php

require_once __DIR__ . '/vendor/autoload.php';

use LiveChat\Api\Client as LiveChat;

$LiveChatAPI = new LiveChat('%login%', '%apiKey%');
$agents = $LiveChatAPI->agents->get();

Available methods

Methods returns stdClass (parsed JSON response).

Agents

Agents REST API documentation.

  • $LiveChatAPI->agents->get($login = null)
  • $LiveChatAPI->agents->add(array $vars)
  • $LiveChatAPI->agents->update($login, array $vars)
  • $LiveChatAPI->agents->delete($login)

Canned responses

Canned responses REST API documentation.

  • $LiveChatAPI->cannedResponses->get($group = 0)
  • $LiveChatAPI->cannedResponses->getSingleResponse($id)
  • $LiveChatAPI->cannedResponses->addNewResponse($text, $tags)
  • $LiveChatAPI->cannedResponses->updateResponse($id, $text, $tags)
  • $LiveChatAPI->cannedResponses->deleteResponse($id)

Chat archives

Archives REST API documentation.

  • $LiveChatAPI->chats->get($params = array())
  • $LiveChatAPI->chats->getSingleChat($chatId)
  • $LiveChatAPI->chats->updateTags($id, array $vars)

Goals

Goals REST API documentation.

  • $LiveChatAPI->goals->markAsSuccessful($goalId)

Groups

Groups REST API documentation.

  • $LiveChatAPI->groups->get($group = 0)
  • $LiveChatAPI->groups->update($id, array $vars)
  • $LiveChatAPI->groups->add(array $vars)
  • $LiveChatAPI->groups->delete($id)

Reports

Reports REST API documentation.

  • $LiveChatAPI->reports->get($type, array $params = array())

Status

Status REST API documentation.

  • $LiveChatAPI->status->get($group = 0)

Tickets

Tickets REST API documentation.

  • $LiveChatAPI->tickets->get(array $params = array())
  • $LiveChatAPI->tickets->getSingleTicket($ticketId)
  • $LiveChatAPI->tickets->add(array $vars)
  • $LiveChatAPI->tickets->updateTags($id, array $vars)

Visitors

Visitors REST API documentation.

  • $LiveChatAPI->visitors->get(array $params = array())

To do

  • Tests for models
  • Add all supported API methods

api-client-php's People

Contributors

bgurney avatar hagii avatar jakehaas avatar lukiq avatar morus12 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.