messente/messente-api-php

[Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world.


Keywords
php, rest, api, sms, sdk, whatsapp, openapi, telegram, phonebook, viber, openapitools, openapi-generator, number-lookup, omnichannel, statistics
License
Unlicense

Documentation

Messente API Library

  • Messente API version: 1.4.0
  • PHP artifact version: 1.4.0

Messente is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds tools to help organizations connect their services to people anywhere in the world.

Installation

Install Messente API library with composer require messente/messente-api-php.

Features

Messente API has the following features:

Messente API Library provides the operations described below to access the features.

BlacklistApi

  1. Adds a phone number to the blacklist addToBlacklist
  2. Deletes a phone number from the blacklist deleteFromBlacklist
  3. Returns all blacklisted phone numbers fetchBlacklist
  4. Checks if a phone number is blacklisted isBlacklisted

ContactsApi

  1. Adds a contact to a group addContactToGroup
  2. Creates a new contact createContact
  3. Deletes a contact deleteContact
  4. Lists a contact fetchContact
  5. Lists groups of a contact fetchContactGroups
  6. Returns all contacts fetchContacts
  7. Removes a contact from a group removeContactFromGroup
  8. Updates a contact updateContact

DeliveryReportApi

  1. Retrieves the delivery report for the Omnimessage retrieveDeliveryReport

GroupsApi

  1. Creates a new group with the provided name createGroup
  2. Deletes a group deleteGroup
  3. Lists a group fetchGroup
  4. Returns all groups fetchGroups
  5. Updates a group with the provided name updateGroup

NumberLookupApi

  1. Requests info about phone numbers fetchInfo

OmnimessageApi

  1. Cancels a scheduled Omnimessage cancelScheduledMessage
  2. Sends an Omnimessage sendOmnimessage

StatisticsApi

  1. Requests statistics reports for each country createStatisticsReport

Auth

Type: HTTP basic authentication

Read the external getting-started article which explains API keys and Sender ID logic.

Getting started: sending an omnimessage

<?php
require_once(__DIR__ . '/../vendor/autoload.php');

use \Messente\Api\Api\OmnimessageApi;
use \Messente\Api\Configuration;
use \Messente\Api\Model\Omnimessage;
use \Messente\Api\Model\Viber;
use \Messente\Api\Model\SMS;
use \Messente\Api\Model\WhatsApp;
use \Messente\Api\Model\WhatsAppText;


// Configure HTTP basic authorization: basicAuth
$config = Configuration::getDefaultConfiguration()
    ->setUsername('<MESSENTE_API_USERNAME>')
    ->setPassword('<MESSENTE_API_PASSWORD>');

$apiInstance = new OmnimessageApi(
    new GuzzleHttp\Client(),
    $config
);

$omnimessage = new Omnimessage([
    "to" => "<phone number in e.164 format>"
]);

$viber = new Viber(
    ["text" => "Hello Viber!", "sender" => "MyViberSender"]
);

$sms = new SMS(
    ["text" => "Hello SMS!", "sender" => "MySmsSender"]
);


$whatsAppText = new WhatsAppText(["body" => "Hello WhatsApp!"]);

$whatsapp = new WhatsApp(
    ['text' => $whatsAppText, "sender" => "MyWhatsAppSender"]
);

$omnimessage->setMessages([$whatsapp, $viber, $sms]);


try {
    $result = $apiInstance->sendOmnimessage($omnimessage);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling sendOmnimessage: ', $e->getMessage(), PHP_EOL;
}
?>

License

Apache-2.0

Terms

https://messente.com/terms-and-conditions