Last active
February 21, 2017 19:31
-
-
Save Bogdaan/72f4bb292e4a2f79e2f0d4ca582dd4b1 to your computer and use it in GitHub Desktop.
Get account info for viber IM
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * Before you run this example: | |
| * 1. copy config.php.dist to config.php: cp config.php.dist config.php | |
| * | |
| * @author Novikov Bogdan <hcbogdan@gmail.com> | |
| */ | |
| error_reporting(E_ALL & ~E_NOTICE & ~E_WARNING); | |
| ini_set('display_errors', 1); | |
| ini_set('display_startup_errors', 1); | |
| require_once("../vendor/autoload.php"); | |
| use Viber\Client; | |
| $apiKey = $config['apiKey']; // from PA "Edit Details" page | |
| try { | |
| $client = new Client([ 'token' => $apiKey ]); | |
| $result = $client->getAccountInfo(); | |
| print_r($result); | |
| } catch (Exception $e) { | |
| echo "Error: ". $e->getError() ."\n"; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment