khipu/khipu-chaski-api-client

1.1.2 2020-03-11 18:07 UTC

This package is auto-updated.

Last update: 2024-10-12 03:34:13 UTC


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();
 }


?>