Skip to content
SDK for api-messenger.com
PHP
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src 🔌 made it packagist-ready Apr 27, 2019
.gitignore 🔌 made it packagist-ready Apr 27, 2019
LICENSE Initial commit Dec 6, 2018
README.md 🔌 made it packagist-ready Apr 27, 2019
composer.json 🔌 made it packagist-ready Apr 27, 2019

README.md

API-Messenger SDK

Library making work with api-messenger.com easier

Installation

Just download src/apimessenger.php or use Composer:

composer require mikechip/apimessenger

Create instance

  $api = new ApiMessenger(
        '_token_', // api-messenger.com token
  );

Get QR code

Proxying via PHP:

header('Content-Type: image/png');
readfile( $api->getQRCode() );

Or show directly:

<img src="<?=$api->getQRCode();?>" />

Send message

    $result = $api->sendPhoneMessage('+12345', 'It works!');
    
    print(
        ($result['status'] == 'OK') ? 'Message sent' : 'Fail'
    );

Feedback

Use Issues to contact me

You can’t perform that action at this time.