mprofi/api-client

mProfi api client implementation

v1.0.3 2016-05-06 08:28 UTC

This package is not auto-updated.

Last update: 2024-05-03 17:30:07 UTC


README

Build Status

Simple library for sending messages using mProfi API. This library provides classes and methods for sending single or many messages at once.

Installation

You can install it using composer:

composer require mprofi/api-client

Usage

Single message

You can send single message like this

$message = new mprofi\Message('5556667777', 'some message content');
$client = new mprofi\Client('api-token');

$messageIds = $client->send($message);

Many messages

Sending many messages at one is almost the same as sending single message:

$messages = [
    new mprofi\Message('5556667777', 'first message content'),
    new mprofi\Message('5556668888', 'second message content'),
];

$client = new mprofi\Client('api-token');
$messageIds = $client->send($messages);

Get message status

While sending messages you get ids so you can later check status:

$client = new mprofi\Client('api-token');

$client->getStatus();