banckle/chat-bundle

This is a symfony2 bundle to use Banckle.Chat SDK for PHP in symfony2 applications quickly and easily.

dev-master 2014-10-14 15:51 UTC

This package is not auto-updated.

Last update: 2024-10-08 08:21:55 UTC


README

#Banckle.Chat for Symfony

This bundle allows you to work with Banckle.Chat SDK in your Symfony applications quickly and easily.

Installation

Add the following lines to your composer.json file:

// composer.json
{
    // ...
    require: {
        // ..
        "banckle/chat-sdk-php": "dev-master",
        "banckle/chat-bundle": "dev-master"

    }
}

Now, you can install the new dependencies by running Composer's update command from the directory where your composer.json file is located.

    composer update

Update your AppKernel.php file, and register the new bundle:

// app/AppKernel.php
public function registerBundles()
{
    // ...
     new Banckle\ChatBundle\BanckleChatBundle(),
    // ...
);
}

Configuration

Add this to your config.yml:

banckle_chat:
    #(Required) Your Account apiKey from apps.banckle.com
    apiKey: "XXXXXXXXXXXXX"
    banckleAccountUri: "https://apps.banckle.com/api/v2"
    banckleChatUri: "https://chat.banckle.com/v3"

Usage

The Bundle is called as a standard service.

To access service:
$bancklechat = $this->get('bancklechat.api');

To generate token:
$bancklechat = $this->get('bancklechat.api');
$token = $bancklechat->getToken($email, $password);

To access all departments:
$department = $bancklechat->createInstance('DepartmentsApi', $token);
$result = $department->getDepartments();