khipu / khipu-chaski-api-client
1.1.2
2020-03-11 18:07 UTC
Requires
- php: >=5.3.3
- ext-curl: *
- ext-json: *
- ext-mbstring: *
Requires (Dev)
- phpunit/phpunit: ~4.0
- satooshi/php-coveralls: ~0.6.1
- squizlabs/php_codesniffer: ~2.0
README
Add the dependency khipu/khipu-chaski-api-client to composer.json and run
composer install
Usage
Basic usage
<?php require __DIR__ . '/vendor/autoload.php'; $c = new KhipuChaski\Configuration(); $c->setSecret("tobechanged"); $c->setReceiverId(123456789); $c->setDebug(true); $cl = new KhipuChaski\ApiClient($c); $notificationsApi = new KhipuChaski\Client\PushNotificationsApi($cl); try{ $message = new KhipuChaski\Model\Message(); $message->setSubject("subject"); $message->setBody("Hello world!"); $message->setRecipientIdSet(array("recipientId")); $response = $notificationsApi->sendMessage($message); print_r($response); } catch(Exception $e){ echo $e->getMessage(); } ?>