digitaleo / php-sdk
PHP client for Digitaleo's API
Installs: 5
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 4
Forks: 0
Open Issues: 0
Type:lib
Requires
- php: >=5.4.0
- ext-curl: *
- guzzlehttp/guzzle: ^6.2.1
Requires (Dev)
- phpunit/phpunit: ^5.3
This package is auto-updated.
Last update: 2024-10-30 01:31:45 UTC
README
Digitaleo PHP SDK
This library aims to give to developers a nice SDK to work with Digitaleo's APIs.
How to use it
In your project directory :
Run
composer require digitaleo/php-sdk
And use it like this :
<?php require './vendor/autoload.php'; $credentials = new \Digitaleo\SDK\Api\Credentials( 'your-client-id', 'your-client-secret', 'your-username', 'your-password' ); $adapter = new \Digitaleo\SDK\Api\Authentication\OAuth2Adapter($credentials); $client = new \Digitaleo\SDK\Api\Client($adapter); # How to post a contact $response = $client->post('https://contacts.messengeo.net/rest/contacts', [ 'contacts' => [ ['civility' => 'M', 'firstName' => 'Michel', 'lastName' => 'Patrick', 'phone' => '0605040302'], ], ]); # How to retrieve your campaigns $response = $client->get('https://api.messengeo.net/rest/campaigns');
Roadmap
- Basic HTTP Client with oAuth
- Add tests
- Add doc
- Find a way to avoid passing the complete URL as a resource
- Update HTTP Client to give a nice "Active Record" like interface