mikechip/apimessenger

api-messenger.com PHP SDK

1.1.0 2019-04-27 07:16 UTC

This package is auto-updated.

Last update: 2024-05-24 00:33:28 UTC


README

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 Mike4ip\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