2017 © Pedro Peláez
 

library messageapi-php

Send and receive messages from any chat app, using one API

image

messageapi/messageapi-php

Send and receive messages from any chat app, using one API

  • Sunday, September 17, 2017
  • by itzik
  • Repository
  • 1 Watchers
  • 0 Stars
  • 0 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

messageapi.im

Documentaion, (*1)

To authorize, use this code:, (*2)

require_once ('messageapi.php');
$messageapi=new \messageapi\messageapi('<YOUR_APP_SECRET>');

Quick example:

Create Integration

$result=$messageapi->integrations->Create('{
    "type":"line",
    "bot_id":"<BOT_ID>",
    "access_token":"<ACCESS_TOKEN>"
}');

Create Customer

$result=$messageapi->customers->Create('{
    "email":"email@domain.com",
    "line":{"user_id":"225451339750443406022273244"}
}')

Send message

$result=$messageapi->messaging->SendMessage('{
    "_customer_id":"customer_id",
    "messengerType":"line",
    "message":{
        "type":"text",
        "content":"your text"
    }
}')

Add Webhook

$result=$messageapi->webhooks->Create('{
    "event":"received_message",
    "webhook_url":"http://yourpath.com/path"
}')

More Examples:

Integrations

Get
$messageapi->integrations->Get('<ID_INTEGRATION>');

```php $messageapi->integrations->GetAll();, (*3)

##### Create
```php
$messageapi->integrations->Create('{
    "type":"line",
    "bot_id":"<BOT_ID>",
    "access_token":"<ACCESS_TOKEN>"}');
Update
$messageapi->integrations->Update('<ID_INTEGRATION>','{
    "type":"line",
    "bot_id":"<BOT_ID>",
    "access_token":"<ACCESS_TOKEN>"}');
Delete
 $messageapi->integrations->Remove('<ID_INTEGRATION>');

Customers

Get
$messageapi->customers->Get('<ID_CUSTOMER>');

```php $messageapi->customers->GetAll();, (*4)


##### Create ```php $messageapi->customers->Create('{ "email":"email@domain.com", "line":{"user_id":"<USER_ID_OF_LINE>"}}');
Update
$messageapi->customers->Create('<ID_CUSTOMER>','{
    "email":"email@domain.com",
    "line":{"user_id":"<USER_ID_OF_LINE>"}}');
Delete
$messageapi->customers->Remove('<ID_CUSTOMER>');

The Versions

17/09 2017

dev-master

9999999-dev http://messageapi.im

Send and receive messages from any chat app, using one API

  Sources   Download

MIT

The Requires

  • php >=5.3.2

 

javascript bot sdk messaging telegram twilio line wechat messenger viber telegram-api facebook-messenger kik messageapi messageapi-php message-api messagess messenger-api facebook-messenger-api line-api viber-api kik-api wechat-api twilio-api