PHPackages                             ippanel/php-rest-sdk - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. ippanel/php-rest-sdk

ActiveLibrary[API Development](/categories/api)

ippanel/php-rest-sdk
====================

IPPanel REST API client

v2.0.4(3y ago)2740.8k↓23.9%15[8 issues](https://github.com/ippanel/php-rest-sdk/issues)[4 PRs](https://github.com/ippanel/php-rest-sdk/pulls)7BSD-2-ClausePHPPHP &gt;=7.0CI failing

Since Feb 18Pushed 2y ago6 watchersCompare

[ Source](https://github.com/ippanel/php-rest-sdk)[ Packagist](https://packagist.org/packages/ippanel/php-rest-sdk)[ Docs](https://github.com/ippanel/php-rest-sdk)[ RSS](/packages/ippanel-php-rest-sdk/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (5)Used By (7)

IPPanel SMS php api SDK
=======================

[](#ippanel-sms-php-api-sdk)

[![Build Status](https://camo.githubusercontent.com/c467308e5d7f2debb8acf5a7d0f9cfa76ee940f5f497592fc6708a18fd107442/68747470733a2f2f7472617669732d63692e6f72672f697070616e656c2f7068702d726573742d73646b2e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/ippanel/php-rest-sdk)

Installation
------------

[](#installation)

use with composer:

```
composer require ippanel/php-rest-sdk
```

if you don't want to use composer, you can download it directly :

```
wget https://github.com/ippanel/php-rest-sdk/archive/master.zip
```

Examples
--------

[](#examples)

For using sdk, you have to create a client instance that gives you available methods on API

```
require 'autoload.php';

// you api key that generated from panel
$apiKey = "api-key";

$client = new \IPPanel\Client($apiKey);

...
```

### Credit check

[](#credit-check)

```
# return float64 type credit amount
$credit = $client->getCredit();
```

### Send one to many

[](#send-one-to-many)

For sending sms, obviously you need `originator` number, `recipients` and `message`.

```
$messageId = $client->send(
    "+9810001",          // originator
    ["98912xxxxxxx"],    // recipients
    "ippanel is awesome",// message
    "description"        // is logged
);
```

If send is successful, a unique tracking code returned and you can track your message status with that.

### Get message summery

[](#get-message-summery)

```
$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
```

### Get message delivery statuses

[](#get-message-delivery-statuses)

```
$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);
```

### Inbox fetch

[](#inbox-fetch)

fetch inbox messages

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

### Pattern create

[](#pattern-create)

For sending messages with predefined pattern(e.g. verification codes, ...), you hav to create a pattern. a pattern at least have a parameter.

```
$patternVariables = [
    "name" => "string",
    "code" => "integer",
];

$code = $client->createPattern("%name% is awesome, your code is %code%", "description",
    $patternVariables, '%', False);

echo $code;
```

### Send with pattern

[](#send-with-pattern)

```
$patternValues = [
    "name" => "IPPANEL",
];

$messageId = $client->sendPattern(
    "t2cfmnyo0c",    // pattern code
    "+9810001",      // originator
    "98912xxxxxxx",  // recipient
    $patternValues,  // pattern values
);
```

### Error checking

[](#error-checking)

```
use IPPanel\Errors\Error;
use IPPanel\Errors\HttpException;

try{
    $messageId = $client->send("9810001", ["98912xxxxx"], "ippanel is awesome");
} catch (Error $e) { // ippanel error
    var_dump($e->unwrap()); // get real content of error
    echo $e->getCode();

    // error codes checking
    if ($e->code() == ResponseCodes::ErrUnprocessableEntity) {
        echo "Unprocessable entity";
    }
} catch (HttpException $e) { // http error
    var_dump($e->getMessage()); // get stringified error
    echo $e->getCode();
}
```

###  Health Score

35

—

LowBetter than 80% of packages

Maintenance14

Infrequent updates — may be unmaintained

Popularity40

Moderate usage in the ecosystem

Community23

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 75% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~323 days

Total

4

Last Release

1311d ago

Major Versions

v1.0.1 → v2.0.02022-08-31

PHP version history (2 changes)v1.0.1PHP &gt;=5.3.3

v2.0.0PHP &gt;=7.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/61179280?v=4)[ippanel](/maintainers/ippanel)[@ippanel](https://github.com/ippanel)

---

Top Contributors

[![saberima](https://avatars.githubusercontent.com/u/6442172?v=4)](https://github.com/saberima "saberima (3 commits)")[![ippanel](https://avatars.githubusercontent.com/u/61179280?v=4)](https://github.com/ippanel "ippanel (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/ippanel-php-rest-sdk/health.svg)

```
[![Health](https://phpackages.com/badges/ippanel-php-rest-sdk/health.svg)](https://phpackages.com/packages/ippanel-php-rest-sdk)
```

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M480](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M272](/packages/twilio-sdk)[facebook/php-business-sdk

PHP SDK for Facebook Business

90821.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

74513.7M114](/packages/meilisearch-meilisearch-php)[google/gax

Google API Core for PHP

265103.1M454](/packages/google-gax)[google/common-protos

Google API Common Protos for PHP

173103.7M50](/packages/google-common-protos)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
