This package is a PHP wrapper for the Genesys API. The package provides a fluent syntax to interact with the API.
- Installation
- Usage
- Testing
- Changelog
- Contributing
- Security Vulnerabilities
- Credits
- License
You can install the package via composer:
composer require vormkracht10/genesys-api
This package only provides a way to interact with the API. To handle the authentication logic we created the oauth2-genesys package which provides a league/oauth2-client provider for Genesys.
use Vormkracht10\GenesysApi\Genesys;
$accessToken = '{access-token}';
$genesys = Genesys::api(
region: 'us-west-1', // optional, default is 'us-east-1'
accessToken: $accessToken
);
$genesys->conversations()->get(id: '{conversation-id}');
$genesys->conversations()->list();
$genesys->conversations()->create(
params: []
);
$genesys->conversations()->messages(id: '{conversation-id}');
$genesys->conversations()->message(
conversationId: '{conversation-id}',
messageId: '{message-id}'
);
$genesys->conversations()->getMessageDraft(
conversationId: '{conversation-id}',
);
$genesys->conversations()->updateMessageDraft(
conversationId: '{conversation-id}',
params: []
);
$genesys->conversations()->updateParticipant(
conversationId: '{conversation-id}',
participantId: '{participant-id}',
params: []
);
$genesys->conversations()->emails(id: '{conversation-id}');
$genesys->conversations()->updateAttributes(
conversationId: '{conversation-id}',
participantId: '{participant-id}',
params: [
'labels' => ['Done', 'Mailed customer']
]
);
$genesys->conversations()->replaceParticipant(
conversationId: '{conversation-id}',
participantId: '{participant-id}',
params: [
'userId' => '{user-id}'
]
);
$genesys->users()->get(id: '{user-id}');
// With parameters
$genesys->users()->get(id: '{user-id}', params: ['expand' => 'languagePreference']);
$genesys->users()->list();
$genesys->users()->create([
'name' => 'Test',
'department' => 'Test Department',
'email' => 'test@testdepartment.com',
'addresses' => [],
'title' => 'Lorem Ipsum',
'password' => 'P1hQrt4WytLxz2gF%LYc',
'divisionId' => null,
'state' => 'active',
])
$genesys->users()->update(
id: '{user-id}',
params: [
'name' => 'New name',
]);
$genesys->users()->delete(id: '{user-id}');
$genesys->users()->queues(id: '{user-id}');
$genesys->queues()->get(id: '{queue-id}');
$genesys->queues()->list([
'pageNumber' => 1,
'pageSize' => 25,
'sortOrder' => 'desc',
]);
$genesys->queues()->create([
'name' => 'Test queue'
]);
$genesys->queues()->update(
id: '{queue-id}',
params: [
'name' => 'New name',
]);
$genesys->queues()->delete(id: '{queue-id}');
$genesys->queues()->getWrapupCodes(
id: '{queue-id}',
params: [
'pageSize' => 25,
'pageNumber' => 1
]
);
$genesys->queues()->members(
id: '{queue-id}',
params: [
'pageSize' => 25,
'pageNumber' => 1
]
);
composer test
Please see CHANGELOG for more information on what has changed recently.
Please see CONTRIBUTING for details.
Please review our security policy on how to report security vulnerabilities.
The MIT License (MIT). Please see License File for more information.