1. Go to this page and download the library: Download ippanel/php-rest-sdk 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/ */
ippanel / php-rest-sdk example snippets
// you api key that generated from panel
$apiKey = "api-key";
$client = new \IPPanel\Client($apiKey);
...
# return float64 type credit amount
$credit = $client->getCredit();
$messageId = $client->send(
"+9810001", // originator
["98912xxxxxxx"], // recipients
"ippanel is awesome",// message
"description" // is logged
);
$messageId = "message-tracking-code";
$message = $client->get_message($messageId);
echo $message->state; // get message status
echo $message->cost; // get message cost
echo $message->returnCost; // get message payback
$messageId = "message-tracking-code"
list($statuses, $paginationInfo) = $client->fetchStatuses($messageId, 0, 10)
// you can loop in messages statuses list
foreach($statuses as status) {
echo sprintf("Recipient: %s, Status: %s", $status->recipient, $status->status);
}
echo sprintf("Total: ", $paginationInfo->total);
list($messages, $paginationInfo) = $client->fetchInbox(0, 10);
foreach($messages as $message) {
echo sprintf("Received message %s from number %s in line %s", $message->message, $message->from, $message->to);
}
$patternVariables = [
"name" => "string",
"code" => "integer",
];
$code = $client->createPattern("%name% is awesome, your code is %code%", "description",
$patternVariables, '%', False);
echo $code;