PHPackages                             inmobile/inmobile-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. inmobile/inmobile-sdk

ActiveLibrary[API Development](/categories/api)

inmobile/inmobile-sdk
=====================

The official PHP library for interaction with the InMobile API

v4.2.1(2mo ago)6213.8k↓17.7%11BSD-3-ClausePHPPHP ^7.4|^8.0CI failing

Since Sep 28Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/inMobile/inMobile-PHP-API-Client)[ Packagist](https://packagist.org/packages/inmobile/inmobile-sdk)[ RSS](/packages/inmobile-inmobile-sdk/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (10)Dependencies (6)Versions (11)Used By (0)

Inmobile PHP SDK for v4
=======================

[](#inmobile-php-sdk-for-v4)

Requirements
------------

[](#requirements)

- PHP 7.4, 8.0, 8.1, 8.2, 8.3, 8.4 or 8.5.

Getting started
---------------

[](#getting-started)

The latest version of the client can be found on packagist [here](https://packagist.org/packages/inmobile/inmobile-sdk)

1. `composer require inmobile/inmobile-sdk`
2. Initialize the `InmobileApi` class and start sending messages!

Each *endpoint* is split into a different class.

So the **messages** API would be accessed by calling `->messages()`, **lists** API by calling `->lists()` and so on.

**Example:**

```
/*
 * Require autoload, to automatically load the SDK, after installing via composer.
 * Execute the following command now, if you haven't already: composer require inmobile/inmobile-sdk
 */
require_once __DIR__ . '/vendor/autoload.php';

use Inmobile\InmobileSDK\InmobileApi;
use Inmobile\InmobileSDK\RequestModels\Message;

/*
 * Initialize the Inmobile API Client
 */
$api = new InmobileApi('my-api-token');

/*
 * Send the message
 */
$response = $api->messages()->send(
    Message::create('This is a message text to be sent')
        ->from('1245')
        ->to('4512345678')
);

$response->toArray();

/**
 * "results": [
 *     {
 *         "numberDetails": {
 *             "countryCode": "45",
 *             "phoneNumber": "12345678",
 *             "rawMsisdn": "45 12 34 56 78",
 *             "isValidMsisdn": true,
 *             "isAnonymized": false
 *         },
 *         "text": "This is a message text to be sent",
 *         "from": "1245",
 *         "smsCount": 1,
 *         "messageId": "INMBL",
 *         "encoding": "gsm7"
 *     }
 * ]
 */
```

You can find the full API documentation here:

Endpoints
---------

[](#endpoints)

The SDK is split up into different classes for each "endpoint" in the InMobile API.

### Messages

[](#messages)

This can be accessed by calling `->messages()` on `InmobileApi`. Below you will find an example of all the actions.

#### Send message

[](#send-message)

Send one or more messages.

```
$api->messages()->send(
    Message::create('Hello World')
        ->from('INMBL')
        ->to(4512345678)
);

$api->messages()->send([
    Message::create('Foobar')
        ->from('INMBL')
        ->to(4512345678),
    Message::create('Barbiz')
        ->from('INMBL')
        ->to(4512345678)
        ->countryHint('DK')
]);
```

#### Send a message using a template

[](#send-a-message-using-a-template)

```
$api->messages()->sendUsingTemplate(
    TemplateMessage::create()
        ->to(4512345678)
        ->setPlaceholders([
            '{name}' => 'John',
            '{lastname}' => 'Doe',
        ]),
    'ecdcb257-c1e9-4b44-8a4e-f05822372d82',
);

// Multiple
$placeholders = [
    '{name}' => 'John',
    '{lastname}' => 'Doe',
];

$api->messages()->sendUsingTemplate([
    TemplateMessage::create()->to(4512345678)->setPlaceholders($placeholders),
    TemplateMessage::create()->to(4512345678)->setPlaceholders($placeholders),
], 'ecdcb257-c1e9-4b44-8a4e-f05822372d82');
```

#### Send message using query

[](#send-message-using-query)

Send one message using query parameters.

```
$api->messages()->sendUsingQuery(
    Message::create('Hello World')
        ->from('INMBL')
        ->to(4512345678)
);
```

#### Get status reports

[](#get-status-reports)

Get all SMS reports

```
$api->messages()->getStatusReport($limit = 20);
```

#### Cancel messages

[](#cancel-messages)

Cancel one or multiple messages by their ID

```
$api->messages()->cancel('MESSAGEID-1');

// Or multiple messages
$api->messages()->cancel(['MESSAGEID-1', 'MESSAGEID-2']);
```

### Lists

[](#lists)

This can be accessed by calling `->lists()` on `InmobileApi`. Below you will find an example of all the actions.

#### Get all

[](#get-all)

Fetch all lists. This automatically runs through every page and returns an array of all lists.

```
$api->lists()->getAll();
```

#### Find

[](#find)

Find a list by its ID

```
$api->lists()->find($listId);
```

#### Create

[](#create)

Create a new list

```
$api->lists()->create($listName);
```

#### Update

[](#update)

Update a list with a new name

```
$api->lists()->update($listId, $newName);
```

#### Delete

[](#delete)

Delete a list by its ID

```
$api->lists()->delete($listId);
```

### Blacklist

[](#blacklist)

This can be accessed by calling `->blacklist()` on `InmobileApi`. Below you will find an example of all the actions.

#### Get

[](#get)

Fetch a paginated list of all entries in your blacklist

```
$api->blacklist()->get($pageLimit = 20);
```

#### Get all

[](#get-all-1)

Fetch all entries in a blacklist. This automatically runs through every page and returns an array of all entries.

```
$api->blacklist()->getAll();
```

#### Find by ID

[](#find-by-id)

Find an entry by ID

```
$api->blacklist()->findEntryById('ENTRYID-1');
```

#### Find by phone number

[](#find-by-phone-number)

Find an entry by phone number

```
$api->blacklist()->findEntryByNumber($countryCode = 45, $phoneNumber = 12345678);
```

#### Create

[](#create-1)

Create a new entry in the blacklist

```
$api->blacklist()->createEntry($countryCode = 45, $phoneNumber = 12345678, $comment = null);
```

#### Delete by ID

[](#delete-by-id)

Delete an entry by ID

```
$api->blacklist()->deleteEntryById('ENTRYID-1');
```

#### Delete by phone number

[](#delete-by-phone-number)

Delete an entry by phone number

```
$api->blacklist()->deleteEntryByNumber($countryCode = 45, $phoneNumber = 12345678);
```

### Recipients

[](#recipients)

This can be accessed by calling `->recipients()` on `InmobileApi`. Below you will find an example of all the actions.

#### Get

[](#get-1)

Get a paginated response of all recipients in a list

```
$api->recipients()->get($listId = 'LIST-1', $limit = 20);
```

#### Get all

[](#get-all-2)

Fetch all recipients on a list. This automatically runs through every page and returns an array of all recipients.

```
$api->recipients()->getAll($listId = 'LIST-1');
```

#### Find by ID

[](#find-by-id-1)

Find a recipient by ID

```
$api->recipients()->findById($listId = 'LIST-1', $id = 'RECIPIENT-1');
```

#### Find by phone number

[](#find-by-phone-number-1)

Find a recipient by phone number

```
$api->recipients()->findByPhoneNumber($listId = 'LIST-1', $countryCode = 45, $phoneNumber = 12345678);
```

#### Create

[](#create-2)

Create a recipient on a list

```
$api->recipients()->create(
    $listId = 'LIST-1',
    Recipient::create(45, 12345678)
        ->addField('firstname', 'John')
        ->addField('lastname', 'Doe')
        ->createdAt(new DateTime('2021-01-02 03:04:05'))
);
```

#### Update

[](#update-1)

Update a recipient on a list

```
$api->recipients()->update(
    $listId = 'LIST-1',
    $id = 'RECIPIENT-1',
    Recipient::create(45, 12345678)
        ->addField('firstname', 'John')
        ->addField('lastname', 'Doe')
        ->createdAt(new DateTime('2021-01-02 03:04:05'))
);
```

#### Create or update

[](#create-or-update)

Create or update a recipient on a list if it doesn't exist.

```
$api->recipients()->createOrUpdateByPhoneNumber(
    $listId = 'LIST-1',
    $countryCode = 45,
    $phoneNumber = 12345678,
    Recipient::create(45, 12345678)
        ->addField('firstname', 'John')
        ->addField('lastname', 'Doe')
);
```

#### Delete by ID

[](#delete-by-id-1)

Delete a recipient by ID

```
$api->recipients()->deleteById($listId = 'LIST-1', $id = 'RECIPIENT-1');
```

#### Delete by phone number

[](#delete-by-phone-number-1)

Delete a recipient by phone number

```
$api->recipients()->deleteByPhoneNumber($listId = 'LIST-1', $countryCode = 45, $phoneNumber = 12345678);
```

#### Delete all recipients on a list

[](#delete-all-recipients-on-a-list)

This deletes all recipients on the given list

```
$api->recipients()->deleteAllFromList($listId = 'LIST-1');
```

### GDPR

[](#gdpr)

#### Create information deletion request

[](#create-information-deletion-request)

```
$api->gdpr()->createDeletionRequest(NumberInfo::create($countryCode = '45', $phoneNumber = '12345678'));
```

### Tools

[](#tools)

#### Parse phone numbers

[](#parse-phone-numbers)

```
$api->tools()->numbersToParse([
    NumberToParse::create($countryHint = 'DK', $rawMsisdn = '12 34 56 78')
    NumberToParse::create($countryHint = '45', $rawMsisdn = '12 34 56 78')
]);

// If you wish to parse a single number, you can do so by passing a single NumberToParse object
$api->tools()->numbersToParse(NumberToParse::create($countryHint = 'DK', $rawMsisdn = '12 34 56 78'));
```

### Templates

[](#templates)

#### Get all

[](#get-all-3)

Fetch all templates. This automatically runs through every page and returns an array of all templates.

```
$api->templates()->getAll();
```

#### Find

[](#find-1)

Find a template by its ID

```
$api->templates()->find($templateId);
```

### Emails

[](#emails)

#### Send email

[](#send-email)

Send an email to one or more recipients with the specified subject and text / html body.

```
$api->emails()->send(
    Email::create()
        ->from(EmailRecipient::create('john@example.com', 'John Doe'))
        ->to(EmailRecipient::create('jane@example.com', 'Jane Doe'))
        ->subject('Hello World')
        ->text('Hello World')
        ->html('Hello World')
);
```

#### Send email using template

[](#send-email-using-template)

Send an email to one or more recipients using a template.

```
$api->emails()->sendUsingTemplate(
    Email::create()
        ->from(EmailRecipient::create('john@example.com', 'John Doe'))
        ->to(EmailRecipient::create('jane@example.com', 'Jane Doe'))
        ->templateId('ABCDEF12-3456-7890-ABCD-EF1234567890')
);
```

#### Get email events

[](#get-email-events)

Get a paginated list of email events.

```
$api->emails()->getEvents($limit = 20);
```

### Email templates

[](#email-templates)

#### Get all

[](#get-all-4)

Fetch all email templates. This automatically runs through every page and returns an array of all templates.

```
$api->emailTemplates()->getAll();
```

#### Find

[](#find-2)

Find an email template by its ID

```
$api->emailTemplates()->find($templateId);
```

###  Health Score

55

—

FairBetter than 97% of packages

Maintenance84

Actively maintained with recent releases

Popularity42

Moderate usage in the ecosystem

Community18

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

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 ~184 days

Recently: every ~200 days

Total

10

Last Release

82d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/63b04cf2c9380bbfe3311cbcd472421a04dc08989d9e91c11cfacca045669a15?d=identicon)[Inmobile](/maintainers/Inmobile)

---

Top Contributors

[![Talkar](https://avatars.githubusercontent.com/u/2336860?v=4)](https://github.com/Talkar "Talkar (24 commits)")[![kristho91](https://avatars.githubusercontent.com/u/2781949?v=4)](https://github.com/kristho91 "kristho91 (24 commits)")[![inMobileBuildBot](https://avatars.githubusercontent.com/u/37399783?v=4)](https://github.com/inMobileBuildBot "inMobileBuildBot (7 commits)")[![reimarwork](https://avatars.githubusercontent.com/u/91725969?v=4)](https://github.com/reimarwork "reimarwork (3 commits)")[![inmobileTalkar](https://avatars.githubusercontent.com/u/32129806?v=4)](https://github.com/inmobileTalkar "inmobileTalkar (2 commits)")[![juanparati](https://avatars.githubusercontent.com/u/835173?v=4)](https://github.com/juanparati "juanparati (1 commits)")[![gemal](https://avatars.githubusercontent.com/u/69105?v=4)](https://github.com/gemal "gemal (1 commits)")[![nmeid](https://avatars.githubusercontent.com/u/24371986?v=4)](https://github.com/nmeid "nmeid (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/inmobile-inmobile-sdk/health.svg)

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

###  Alternatives

[exsyst/swagger

A php library to manipulate Swagger specifications

35916.4M7](/packages/exsyst-swagger)[hubspot/api-client

Hubspot API client

24016.2M20](/packages/hubspot-api-client)[pocketmine/bedrock-protocol

An implementation of the Minecraft: Bedrock Edition protocol in PHP

172445.0k15](/packages/pocketmine-bedrock-protocol)[botman/driver-telegram

Telegram driver for BotMan

93459.5k6](/packages/botman-driver-telegram)

PHPackages © 2026

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