PHP client for connecting to the LiveChat REST API.
To find out more, visit the official LiveChat REST API documentation.
Previous version of LiveChat API Client.
- PHP 5.3 or greater
- cUrl extension enabled
Authentication to the API occurs via HTTP Basic Auth. Provide your:
- login
- API key
More information: http://developers.livechatinc.com/rest-api/#authentication
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
This operation requires PHPUnit installed.
$ phpunit
<?php
require_once __DIR__ . '/vendor/autoload.php';
use LiveChat\Api\Client as LiveChat;
$LiveChatAPI = new LiveChat('%login%', '%apiKey%');
$agents = $LiveChatAPI->agents->get();
Methods returns stdClass
(parsed JSON response).
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 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)
$LiveChatAPI->chats->get($params = array())
$LiveChatAPI->chats->getSingleChat($chatId)
$LiveChatAPI->chats->updateTags($id, array $vars)
$LiveChatAPI->goals->markAsSuccessful($goalId)
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 REST API documentation.
$LiveChatAPI->reports->get($type, array $params = array())
Status REST API documentation.
$LiveChatAPI->status->get($group = 0)
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 REST API documentation.
$LiveChatAPI->visitors->get()
- Tests for models
- Add all supported API methods