Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/messente/messente-api-php

Messente API library: https://packagist.org/packages/messente/messente-api-php
https://github.com/messente/messente-api-php

number-lookup omnichannel phonebook statistics

Last synced: 25 days ago
JSON representation

Messente API library: https://packagist.org/packages/messente/messente-api-php

Awesome Lists containing this project

README

        

# Messente API Library

- Messente API version: 2.0.0
- PHP artifact version: 3.2.0

[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.

## Installation

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

## Features

Messente API has the following features:

- Omnichannel ([external docs](https://messente.com/documentation/omnichannel-api)),
- Phonebook ([external docs](https://messente.com/documentation/phonebook-api)).

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

### BlacklistApi

1. Adds a phone number to the blacklist [`addToBlacklist`](docs/Api/BlacklistApi.md#addtoblacklist)
1. Deletes a phone number from the blacklist [`deleteFromBlacklist`](docs/Api/BlacklistApi.md#deletefromblacklist)
1. Returns all blacklisted phone numbers [`fetchBlacklist`](docs/Api/BlacklistApi.md#fetchblacklist)
1. Checks if a phone number is blacklisted [`isBlacklisted`](docs/Api/BlacklistApi.md#isblacklisted)

### BulkMessagingApi

1. Sends a bulk Omnimessage [`sendBulkOmnimessage`](docs/Api/BulkMessagingApi.md#sendbulkomnimessage)

### ContactsApi

1. Adds a contact to a group [`addContactToGroup`](docs/Api/ContactsApi.md#addcontacttogroup)
1. Creates a new contact [`createContact`](docs/Api/ContactsApi.md#createcontact)
1. Deletes a contact [`deleteContact`](docs/Api/ContactsApi.md#deletecontact)
1. Lists a contact [`fetchContact`](docs/Api/ContactsApi.md#fetchcontact)
1. Lists groups of a contact [`fetchContactGroups`](docs/Api/ContactsApi.md#fetchcontactgroups)
1. Returns all contacts [`fetchContacts`](docs/Api/ContactsApi.md#fetchcontacts)
1. Removes a contact from a group [`removeContactFromGroup`](docs/Api/ContactsApi.md#removecontactfromgroup)
1. Updates a contact [`updateContact`](docs/Api/ContactsApi.md#updatecontact)

### DeliveryReportApi

1. Retrieves the delivery report for the Omnimessage [`retrieveDeliveryReport`](docs/Api/DeliveryReportApi.md#retrievedeliveryreport)

### GroupsApi

1. Creates a new group with the provided name [`createGroup`](docs/Api/GroupsApi.md#creategroup)
1. Deletes a group [`deleteGroup`](docs/Api/GroupsApi.md#deletegroup)
1. Lists a group [`fetchGroup`](docs/Api/GroupsApi.md#fetchgroup)
1. Returns all groups [`fetchGroups`](docs/Api/GroupsApi.md#fetchgroups)
1. Updates a group with the provided name [`updateGroup`](docs/Api/GroupsApi.md#updategroup)

### NumberLookupApi

1. Requests info about phone numbers [`fetchInfo`](docs/Api/NumberLookupApi.md#fetchinfo)

### OmnimessageApi

1. Cancels a scheduled Omnimessage [`cancelScheduledMessage`](docs/Api/OmnimessageApi.md#cancelscheduledmessage)
1. Sends an Omnimessage [`sendOmnimessage`](docs/Api/OmnimessageApi.md#sendomnimessage)

### StatisticsApi

1. Requests statistics reports for each country [`createStatisticsReport`](docs/Api/StatisticsApi.md#createstatisticsreport)

## Auth

**Type**: HTTP basic authentication

Read the [external getting-started article](https://messente.com/documentation/getting-started) which explains API keys and Sender ID logic.

## Getting started: sending an omnimessage

```php
setUsername('')
->setPassword('');

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

$omnimessage = new Omnimessage([
"to" => ""
]);

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

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

$whatsAppParameters = [new WhatsAppParameter(['type' => 'text', 'text' => 'hello whatsapp'])];
$whatsAppComponent = new WhatsAppComponent(['type' => 'body', 'parameters' => $whatsAppParameters]);
$whatsAppLanguage = new WhatsAppLanguage(['code' => '']);
$whatsAppTemplate = new WhatsAppTemplate(
[
'name'=> '',
'language'=> $whatsAppLanguage,
'components' => [$whatsAppComponent]
]
);

$whatsapp = new WhatsApp(
[
'sender' => '',
'template' => $whatsAppTemplate,
]
);

$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](http://www.apache.org/licenses/LICENSE-2.0.html)

## Terms

[https://messente.com/terms-and-conditions](https://messente.com/terms-and-conditions)