PHP code example of pushapi / client-php

1. Go to this page and download the library: Download pushapi/client-php 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/ */

    

pushapi / client-php example snippets




use \RequestManagers\CurlRequestManager;

$requestManager = new CurlRequestManager("http://my_uri.com/", 8080);
$client = new PushApi_Client("my_app_id", "my_app_name", "my_secret", $requestManager);

try {
    $userId = 1;
	$user = $client->getUser($userId);
	echo $user['result']['email'] . "\n";
} catch (Exception $e) {
	echo "Exception - " . $e->getMessage() . "\n";
}