frankkessler / incontact-laravel-oauth2-rest
An inContact REST api wrapper utilizing oAuth2
Installs: 96
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Type:project
Requires
- php: >=5.5.9
- frankkessler/guzzle-oauth2-middleware: 0.1.*
- guzzlehttp/guzzle: ~6.0
- illuminate/database: ~5.1
- illuminate/http: ~5.1
- illuminate/routing: ~5.1
- illuminate/support: ~5.1
- psr/log: ~1.0
Requires (Dev)
- mockery/mockery: 0.9.*
- phpspec/phpspec: ~2.1
- phpunit/phpunit: ~4.0
- satooshi/php-coveralls: 1.*
This package is not auto-updated.
Last update: 2024-09-28 19:36:27 UTC
README
INSTALLATION
To install this package, add the following to your composer.json file
frankkessler/incontact-laravel-oauth2-rest: "0.2.*"
LARAVEL 5 SPECIFIC INSTALLATION TASKS
Add the following to your config/app.php file in the providers array
Frankkessler\Incontact\Providers\IncontactLaravelServiceProvider::class,
Add the following to your config/app.php file in the aliases array
'Incontact' => Frankkessler\Incontact\Facades\Incontact::class,
Run the following command to pull the project config file and database migration into your project
php artisan vendor:publish
Run the migration
php artisan migrate
##OPTIONAL INSTALLATION
Logging is enabled by default if using Laravel. If not, add the following to the $config parameter when initializing the Incontact class. (This class must implement the Psr\Log\LoggerInterface interface.)
'incontact.logger' => $class_or_class_name
#TOKEN SETUP
Currently, this package only supports the username/password flow for oauth2.
To get started, you'll have to setup an Application in Incontact.
- Navigate to Manage -> API Applications
- Click "Create API Application"
- Select "Register Internal Application"
- Fill out the form keeping in mind that your OAUTH_CONSUMER_TOKEN will be [APPLICATION_NAME]@[VENDOR_NAME]
- Save and find your business unit if which will be your OAUTH_CONSUMER_SECRET.
Now that you have your Consumer Token and Consumer Secret, add them to your .env file:
INCONTACT_OAUTH_DOMAIN=api.incontact.com INCONTACT_OAUTH_CONSUMER_TOKEN=[APPLICATION_NAME]@[VENDOR_NAME] INCONTACT_OAUTH_CONSUMER_SECRET=BUSINESS_UNIT_NUMBER INCONTACT_OAUTH_SCOPES=RealTimeApi AdminApi ReportingApi INCONTACT_OAUTH_USERNAME=YOUR_INCONTACT_USERNAME INCONTACT_OAUTH_PASSWORD=YOUR_INCONTACT_PASSWORD
EXAMPLES
AdminApi
Get Agents
$incontact = new \Frankkessler\Incontact\Incontact(); $result = $incontact->AdminApi()->agents(); foreach($result['agents'] as $record) { $agentId = $record['AgentId']; }
ReportingApi
Get Call by Contact Id
$incontact = new \Frankkessler\Incontact\Incontact(); $result = $incontact->ReportingApi()->contact('9999999999'); foreach($result as $record) { $contactId = $record['contactId']; }