2017 © Pedro Peláez
 

library live-engage-laravel

LiveEngage package for laravel

image

live-person-inc/live-engage-laravel

LiveEngage package for laravel

  • Wednesday, July 25, 2018
  • by roblesterjr04
  • Repository
  • 6 Watchers
  • 0 Stars
  • 114 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 25 Versions
  • 0 % Grown

The README.md

Live Engage Laravel

Build Status Code Intelligence Status Scrutinizer Code Quality Code Coverage, (*1)

Latest Stable Version Latest Unstable Version Packagist, (*2)

Laravel package to easily tap the LiveEngage developer APIs for such content as Engagement History, Engagement Attributes, and more..., (*3)

Use at your own risk. This package carries no SLA or support and is still currently under development., (*4)

Installation

Install via composer, (*5)

composer require live-person-inc/live-engage-laravel

Register Service Provider

Note! This and next step are optional if you use laravel>=5.5 with package auto discovery feature., (*6)

Add service provider to config/app.php in providers section, (*7)

LivePersonInc\LiveEngageLaravel\ServiceProvider::class,

Register Facade

Register package facade in config/app.php in aliases section, (*8)

'LiveEngage' => LivePersonInc\LiveEngageLaravel\Facades\LiveEngageLaravel::class,

Usage

Create/Obtain an API key from LiveEngage with appropriate permissions for the APIs you intend to access. The default key is required., (*9)

Configure your keys/account in config/services.php, (*10)

'liveperson' => [
    'default' => [
        'key' => 'xxxxxxx',
        'secret' => 'xxxxxxx',
        'token' => 'xxxxxxx',
        'token_secret' => 'xxxxxxx',
        'account' => '123456',
    ]
],

If you want to have multiple API keys, you can add more arrays for them. The keys for each array are arbitrary, but you will need to specify them later to access specific key sets., (*11)

'liveperson' => [
    'default' => [
        'key' => 'xxxxxxx',
        'secret' => 'xxxxxxx',
        'token' => 'xxxxxxx',
        'token_secret' => 'xxxxxxx',
        'account' => '123456',
    ],
    'history' => [
        'key' => 'xxxxxxx',
        'secret' => 'xxxxxxx',
        'token' => 'xxxxxxx',
        'token_secret' => 'xxxxxxx',
        'account' => '123456',
    ],
    'attributes' => [
        'key' => 'xxxxxxx',
        'secret' => 'xxxxxxx',
        'token' => 'xxxxxxx',
        'token_secret' => 'xxxxxxx',
        'account' => '123456',
    ]
],

To make an api call on a specific key set..., (*12)

$history = LiveEngage::key('history')->engagementHistory(); //conversationHistory() for messaging

To use the default keyset, you need not use the key method at all., (*13)

$history = LiveEngage::engagementHistory(); //conversationHistory() for messaging

Example: Capturing engagement history between 2 date/times using global account configured above., (*14)

use LiveEngage;
use Carbon\Carbon;
$start = new Carbon('2018-06-01 08:00:00');
$end = new Carbon('2018-06-03 17:00:00');

/**
 * engagementHistory function.
 * 
 * @access public
 * @param Carbon $start (default: null)
 * @param Carbon $end (default: null)
 * @param mixed $skills (default: [])
 */ 
$history = LiveEngage::engagementHistory($start, $end);

Example: Getting engagement history between 2 date/times for specific skill IDs., (*15)

use LiveEngage;
use Carbon\Carbon;

```php $start = new Carbon('2018-06-01 08:00:00'); $end = new Carbon('2018-06-03 17:00:00'); $skills = [432,676];, (*16)

$history = LiveEngage::engagementHistory($start, $end, $skills);, (*17)

`engagementHistory()` and `conversationHistory()` returns a Laravel collection of Engagement objects.

**Example:** Pulling the next "page" of data in to the collection.

```php
$history->next(); // one page

Or, (*18)

while ($next = $history->next()) { $history = history->merge($next) } // get all remaining data

Example: Iterate through all messages of the transcript, (*19)

$engagement = $history->find('3498290084'); // This is a collection, so random(), first(), last() all work as well

foreach ($engagement->transcript as $message) {  // For messaging conversations, use messageRecords instead of transcript
    echo $message . "\n"; // calling the message object as a string returns its text value
}

Transcript is a collection of message objects, so you can access properties of the message as well., (*20)

echo $message->time->format('Y-m-d'); //The all time properties are Carbon date objects.
$conversation = LiveEngage::conversationHistory()->first();

foreach ($conversation->transfers as $transfer) {
    echo $transfer->targetSkillName . "\n";
}

Example: Get messaging agents availability by skill, (*21)

$availableAgents = LiveEngage::getAgentStatus(17); //Skill ID 17

$online = $availableAgents->state('online');
$away = $availableAgents->state('away');

Security

If you discover any security related issues, please email rlester@liveperson.com instead of using the issue tracker., (*22)

Credits

This package is bootstrapped with the help of melihovv/laravel-package-generator., (*23)

The Versions

25/07 2018

dev-custom-error-handling

dev-custom-error-handling

LiveEngage package for laravel

  Sources   Download

MIT

The Requires

 

The Development Requires

by Robert Lester

laravel live engage

25/07 2018

dev-development

dev-development

LiveEngage package for laravel

  Sources   Download

MIT

The Requires

 

The Development Requires

by Robert Lester

laravel live engage

19/07 2018

dev-master

9999999-dev

LiveEngage package for laravel

  Sources   Download

MIT

The Requires

 

The Development Requires

by Robert Lester

laravel live engage

19/07 2018

0.3.2

0.3.2.0

LiveEngage package for laravel

  Sources   Download

MIT

The Requires

 

The Development Requires

by Robert Lester

laravel live engage

18/07 2018

0.3.1

0.3.1.0

LiveEngage package for laravel

  Sources   Download

MIT

The Requires

 

The Development Requires

by Robert Lester

laravel live engage

06/07 2018

0.3.0

0.3.0.0

LiveEngage package for laravel

  Sources   Download

MIT

The Requires

 

The Development Requires

by Robert Lester

laravel live engage

06/07 2018

dev-coverage-command

dev-coverage-command

LiveEngage package for laravel

  Sources   Download

MIT

The Requires

 

The Development Requires

by Robert Lester

laravel live engage

06/07 2018

dev-request-classes

dev-request-classes

LiveEngage package for laravel

  Sources   Download

MIT

The Requires

 

The Development Requires

by Robert Lester

laravel live engage

06/07 2018

0.2.6

0.2.6.0

LiveEngage package for laravel

  Sources   Download

MIT

The Requires

 

The Development Requires

by Robert Lester

laravel live engage

03/07 2018

0.2.5

0.2.5.0

LiveEngage package for laravel

  Sources   Download

MIT

The Requires

 

The Development Requires

by Robert Lester

laravel live engage

28/06 2018

dev-server-chat

dev-server-chat

LiveEngage package for laravel

  Sources   Download

MIT

The Requires

 

The Development Requires

by Robert Lester

laravel live engage

28/06 2018

0.2.4

0.2.4.0

LiveEngage package for laravel

  Sources   Download

MIT

The Requires

 

The Development Requires

by Robert Lester

laravel live engage

27/06 2018

0.2.3

0.2.3.0

LiveEngage package for laravel

  Sources   Download

MIT

The Requires

 

The Development Requires

by Robert Lester

laravel live engage

27/06 2018

0.2.2

0.2.2.0

LiveEngage package for laravel

  Sources   Download

MIT

The Requires

 

The Development Requires

by Robert Lester

laravel live engage

26/06 2018

0.2.1

0.2.1.0

LiveEngage package for laravel

  Sources   Download

MIT

The Requires

 

The Development Requires

by Robert Lester

laravel live engage

26/06 2018

0.2.0

0.2.0.0

LiveEngage package for laravel

  Sources   Download

MIT

The Requires

 

The Development Requires

by Robert Lester

laravel live engage

19/06 2018

0.1.4

0.1.4.0

LiveEngage package for laravel

  Sources   Download

MIT

The Requires

 

The Development Requires

by Robert Lester

laravel live engage

18/06 2018

0.1.3

0.1.3.0

LiveEngage package for laravel

  Sources   Download

MIT

The Requires

 

The Development Requires

by Robert Lester

laravel live engage

15/06 2018

0.1.2

0.1.2.0

LiveEngage package for laravel

  Sources   Download

MIT

The Requires

 

The Development Requires

by Robert Lester

laravel live engage

15/06 2018

0.1.1

0.1.1.0

LiveEngage package for laravel

  Sources   Download

MIT

The Requires

 

The Development Requires

by Robert Lester

laravel live engage

15/06 2018

0.1.0

0.1.0.0

LiveEngage package for laravel

  Sources   Download

MIT

The Requires

 

The Development Requires

by Robert Lester

laravel live engage

14/06 2018

0.0.5

0.0.5.0

LiveEngage package for laravel

  Sources   Download

MIT

The Requires

 

The Development Requires

by Robert Lester

laravel live engage

13/06 2018

0.0.4

0.0.4.0

LiveEngage package for laravel

  Sources   Download

MIT

The Requires

 

The Development Requires

by Robert Lester

laravel live engage

13/06 2018

0.0.3

0.0.3.0

LiveEngage package for laravel

  Sources   Download

MIT

The Requires

 

The Development Requires

by Robert Lester

laravel live engage

11/06 2018

dev-analysis-8nnGrA

dev-analysis-8nnGrA

LiveEngage package for laravel

  Sources   Download

MIT

The Requires

 

The Development Requires

by Robert Lester

laravel live engage