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>');