khipu/khipu-chaski-api-client

A php wrapper for the khipu chaski APIs


Keywords
php, api, sdk, khipu
License
Apache-2.0

Documentation

Instalation

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


?>