PHPackages                             spryng/spryng-api-http-php - 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. spryng/spryng-api-http-php

ActiveLibrary[API Development](/categories/api)

spryng/spryng-api-http-php
==========================

Spryng API client library for PHP

1.4.0(5y ago)3125.7k↑19.6%4[3 issues](https://github.com/Spryng/SpryngApiHttpPhp/issues)BSD-2-ClausePHP

Since Apr 18Pushed 5y ago3 watchersCompare

[ Source](https://github.com/Spryng/SpryngApiHttpPhp)[ Packagist](https://packagist.org/packages/spryng/spryng-api-http-php)[ Docs](https://github.com/Spryng/SpryngApiHttpPhp)[ RSS](/packages/spryng-spryng-api-http-php/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (6)DependenciesVersions (8)Used By (0)

This version of the SDK is deprecated. Please head over to [this repository](https://github.com/spryng/rest-api-php/) for the REST API SDK, which supports many more features and makes use of our new REST API. This repository will be archived soon.
=======================================================================================================================================================================================================================================================

[](#this-version-of-the-sdk-is-deprecated-please-head-over-to-this-repository-for-the-rest-api-sdk-which-supports-many-more-features-and-makes-use-of-our-new-rest-api-this-repository-will-be-archived-soon)

Spryng PHP API Library
----------------------

[](#spryng-php-api-library)

Hi, welcome to the documentation for the Spryng PHP API Library. This guide contains practical information on how to use the library. Full PHPDOC can be found [in this repository](https://github.com/Spryng/SpryngApiHttpPhpDocs).

### Installation and initialization

[](#installation-and-initialization)

**Using composer**

The easiest way to install the libary is using composer:

```
composer require spryng/spryng-api-http-php

```

When the installation is complete, you can initialize Spryng like so:

```
require( 'vendor/autoload.php');

use SpryngApiHttpPhp\Client;

$spryng = new Client('username', 'password', 'My Company');
```

**Without composer**

If you're not yet using composer, you can use the autoloader:

```
require ('SpryngApiHttpPhp/src/Spryng/Api/Autoloader.php');

$spryng = new Client('username', 'password', 'My Company');
```

### Sending a SMS

[](#sending-a-sms)

To send an SMS, you should use the `Client::sms->send()` method. It takes the following parameters:

- `$recipient` Phone number you're sending the sms to
- `$body` Body of the sms
- `$options` Additional parameters like `allowlong` and `route`

**Options**

There are a number of options you can specify with your request. The requirements for these options are available in the general documentation.

- `route` Enter your assigned route.
- `reference` An optional reference for delivery reports.
- `allowlong` Weather you want to allow Long SMS or not. Should be `true` or `false`.
- `rawencoding` ISO/UTF encoding

**Full example**

```
require( 'vendor/autoload.php')

use SpryngApiHttpPhp\Client;

$spryng = new Client('username', 'password', 'My Company');

try
{
    $spryng->sms->send('31612345678', 'A sample message!', array(
        'route'     => 'business',
         'allowlong' => true
         'reference' => 'ABC123456789'
         'rawencoding' => false)
    );
}
catch (InvalidRequestException $e)
{
    echo $e->getMessage();
}
```

### Requesting credit balance

[](#requesting-credit-balance)

Alongside the ability to send SMS messages, it's also possible to request your current credit balance. This method does not require any parameters and can be used like this:

```
require( 'vendor/autoload.php')

use SpryngApiHttpPhp\Client;

$spryng = new Client('username', 'password', 'My Company');

echo 'Current credit balance: ' . $spryng->sms->checkBalance();
```

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity37

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity68

Established project with proven stability

 Bus Factor1

Top contributor holds 86.7% 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 ~297 days

Total

5

Last Release

2130d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/89756ee91cf468cc56bbc71ec8351fd2ab46ee09c2ef99097cde71944b741ce9?d=identicon)[spryng](/maintainers/spryng)

![](https://www.gravatar.com/avatar/cef747ee5406a851b87106d864e523d5412a4fb8e713f78faf3803186633109f?d=identicon)[complexity](/maintainers/complexity)

---

Top Contributors

[![Roemerb](https://avatars.githubusercontent.com/u/4710404?v=4)](https://github.com/Roemerb "Roemerb (39 commits)")[![JelleManders](https://avatars.githubusercontent.com/u/10434121?v=4)](https://github.com/JelleManders "JelleManders (6 commits)")

---

Tags

phpapismstextgatewayspryng

### Embed Badge

![Health badge](/badges/spryng-spryng-api-http-php/health.svg)

```
[![Health](https://phpackages.com/badges/spryng-spryng-api-http-php/health.svg)](https://phpackages.com/packages/spryng-spryng-api-http-php)
```

###  Alternatives

[checkout/checkout-sdk-php

Checkout.com SDK for PHP

553.3M7](/packages/checkout-checkout-sdk-php)[unicodeveloper/jusibe-php-lib

Jusibe PHP Library

3417.4k1](/packages/unicodeveloper-jusibe-php-lib)[shipu/php-aamarpay-payment

PHP client for Aamarpay Payment Gateway API

3214.6k](/packages/shipu-php-aamarpay-payment)[lakshmaji/plivo

Send SMS using Plivo Cloud API

2016.8k](/packages/lakshmaji-plivo)[lakshmajim/plivo

Send SMS using Plivo Cloud API

205.7k](/packages/lakshmajim-plivo)[okolaa/termiiphp

Termii Rest API php library

112.4k](/packages/okolaa-termiiphp)

PHPackages © 2026

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