PHP code example of khipu / khipu-chaski-api-client

1. Go to this page and download the library: Download khipu/khipu-chaski-api-client library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

khipu / khipu-chaski-api-client example snippets



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