PHPackages                             mogreet/mogreet-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. [Utility &amp; Helpers](/categories/utility)
4. /
5. mogreet/mogreet-php

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

mogreet/mogreet-php
===================

Mogreet PHP Library

32043[1 PRs](https://github.com/jperichon/mogreet-php/pulls)PHP

Since Nov 12Pushed 12y ago2 watchersCompare

[ Source](https://github.com/jperichon/mogreet-php)[ Packagist](https://packagist.org/packages/mogreet/mogreet-php)[ RSS](/packages/mogreet-mogreet-php/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

Introduction
------------

[](#introduction)

This is a PHP wrapper for the Mogreet API. Tests and a solution to install the wrapper using a package manager are coming soon.

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

[](#installation)

For now, you can use **mogreet-php** only by checking out this repo. Others methods will be added later.

First clone the git repo:

```
git clone https://github.com/jperichon/mogreet-php.git

```

Then include the Client:

```
require_once('/path/to/mogreet-php/Mogreet.php');
```

Usage examples
--------------

[](#usage-examples)

### Create a client

[](#create-a-client)

```
require_once('/path/to/mogreet-php/Mogreet.php');

$clientId = 'xxxxx' // Your Client ID from https://developer.mogreet.com/dashboard
$token = 'xxxxx' // Your token from https://developer.mogreet.com/dashboard
$client = new Mogreet($clientId, $token);
```

### Ping

[](#ping)

```
$response = $client->system->ping();
print $response->message;
```

### Send an SMS to one recipient

[](#send-an-sms-to-one-recipient)

```
$response = $client->transaction->send(array(
    'campaign_id' => 'xxxxx', // Your SMS campaign ID from https://developer.mogreet.com/dashboard
    'to' => '9999999999',
    'message' => 'This is super easy!'
));
print $response->messageId;
```

### Send an MMS to one recipient

[](#send-an-mms-to-one-recipient)

```
$response = $client->transaction->send(array(
    'campaign_id' => 'xxxxx', // Your MMS campaign ID from https://developer.mogreet.com/dashboard
    'to' => '9999999999',
    'message' => 'This is super easy!',
    'content_url' => 'https://wp-uploads.mogreet.com/wp-uploads/2013/02/API-Beer-sticker-300dpi-1024x1024.jpg'
));
print $response->messageId;
```

### Upload a media file

[](#upload-a-media-file)

```
$response = $client->media->upload(array(
    'type' => 'image',
    'name' => 'mogreet logo',
    'file' => '/path/to/image/mogreet.png',
    // to ingest a file already online, use: 'url' => 'https://wp-uploads.mogreet.com/wp-uploads/2013/02/API-Beer-sticker-300dpi-1024x1024.jpg'
));
print $response->media->smartUrl;
print '';
print $response->media->contentId;
```

### List all medias

[](#list-all-medias)

```
$response = $client->media->listAll();
foreach($response->mediaList as $media) {
    print $media->contentId . ' => ' . $media->name . ' ' . $media->smartUrl . '';
}
```

Notes
-----

[](#notes)

With the Response object, you can print the plain JSON response of the API call (print $response), or access directly a field (e.g: $response-&gt;message).

Due to the keyword restriction on 'list' and the existing function 'empty()' in PHP, I changed the mappings of the following API calls:

- $client-&gt;\*-&gt;listAll() maps to the method list
- $client-&gt;list-&gt;pruneAll() maps to 'list.empty'

[Full Documentation](https://developer.mogreet.com/docs)
--------------------------------------------------------

[](#full-documentation)

The full documentation for the Mogreet API is available [here](https://developer.mogreet.com/docs)

Prerequisites
-------------

[](#prerequisites)

- PHP &gt;= 5.4
- The PHP JSON extension

###  Health Score

24

—

LowBetter than 31% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/566743?v=4)[Jonathan Perichon](/maintainers/jperichon)[@jperichon](https://github.com/jperichon)

---

Top Contributors

[![jperichon](https://avatars.githubusercontent.com/u/566743?v=4)](https://github.com/jperichon "jperichon (35 commits)")

### Embed Badge

![Health badge](/badges/mogreet-mogreet-php/health.svg)

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

###  Alternatives

[carlescliment/calendar-bundle

A bundle for handling events in calendar

4018.6k](/packages/carlescliment-calendar-bundle)

PHPackages © 2026

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