定制 messagemedia/conversations 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

messagemedia/conversations

Composer 安装命令:

composer require messagemedia/conversations

包简介

The Conversations API allows users to communicate by sending and receiving messages via Over-The-Top (OTT) messaging services. OTT application is an app or service that provides a product over the Internet and bypasses traditional distribution. Here's an in-depth explanation of what the term means.T

关键字:

README 文档

README

PHP version

⚠️ Please note the API documented is in beta and is subject to breaking changes in the short term. ⚠️

The MessageMedia Conversations API allows users to communicate by sending and receiving messages via OTT messaging services. This feature is disabled by default. To enable it, you don't need to make any changes to your application, just an account configuration change by MessageMedia's support team (support@messagemedia.com).

⭐️ Installing via Composer

Run the Composer command to install the latest stable version of the Messages SDK:

composer require messagemedia/conversations-sdk

🎬 Get Started

It's easy to get started. Simply enter the API Key and secret you obtained from the MessageMedia Developers Portal into the code snippet below.

🚀 Provision an account

require_once('vendor/autoload.php');

$basicAuthUserName = 'basicAuthUserName'; // The username to use with basic authentication
$basicAuthPassword = 'basicAuthPassword'; // The password to use with basic authentication

$client = new MessageMediaConversationsLib\MessageMediaConversationsClient($basicAuthUserName, $basicAuthPassword);

$provisioning = $client->getConfiguration();
$bodyValue = "{    \"name\": \"Rainbow Serpent Festival\",    \"callback_url\": \"https://callback.url.com\"}";
$body = MessageMediaConversationsLib\APIHelper::deserialize($bodyValue);
$configuration->createConfigureAccount($body);

🔐 Facebook Authorization

require_once('vendor/autoload.php');

$basicAuthUserName = 'basicAuthUserName'; // The username to use with basic authentication
$basicAuthPassword = 'basicAuthPassword'; // The password to use with basic authentication

$client = new MessageMediaConversationsLib\MessageMediaConversationsClient($basicAuthUserName, $basicAuthPassword);

$facebook = $client->getFacebook();
$result = $facebook->getFacebookAuthorisationURL();

⬇️ Get Facebook pages

require_once('vendor/autoload.php');

$basicAuthUserName = 'basicAuthUserName'; // The username to use with basic authentication
$basicAuthPassword = 'basicAuthPassword'; // The password to use with basic authentication

$client = new MessageMediaConversationsLib\MessageMediaConversationsClient($basicAuthUserName, $basicAuthPassword);
$facebook = $client->getFacebook();
$result = $facebook->getFacebookPages();

♻️ Integrate Facebook page

You can get the facebookPageId by looking at the response of the Get Facebook pages example.

require_once('vendor/autoload.php');

$basicAuthUserName = 'basicAuthUserName'; // The username to use with basic authentication
$basicAuthPassword = 'basicAuthPassword'; // The password to use with basic authentication

$client = new MessageMediaConversationsLib\MessageMediaConversationsClient($basicAuthUserName, $basicAuthPassword);
$facebook = $client->getFacebook();

$facebookPageId = 'facebookPageId';

$facebook->createIntegrateFacebookPage($facebookPageId);

👤 Get users

require_once('vendor/autoload.php');

$basicAuthUserName = 'basicAuthUserName'; // The username to use with basic authentication
$basicAuthPassword = 'basicAuthPassword'; // The password to use with basic authentication

$client = new MessageMediaConversationsLib\MessageMediaConversationsClient($basicAuthUserName, $basicAuthPassword);
$appUsers = $client->getAppUsers();

$result = $appUsers->getAppUsers();

💬 Get user messages

You can get the appUserId from the response of the Get users example.

require_once('vendor/autoload.php');

$basicAuthUserName = 'basicAuthUserName'; // The username to use with basic authentication
$basicAuthPassword = 'basicAuthPassword'; // The password to use with basic authentication

$client = new MessageMediaConversationsLib\MessageMediaConversationsClient($basicAuthUserName, $basicAuthPassword);
$appUsers = $client->getAppUsers();
$appUserId = 'appUserId';

$result = $appUsers->getAppUserMessages($appUserId);

✉️ Send message to user

You can get the appUserId from the response of the Get users example.

require_once('vendor/autoload.php');

$basicAuthUserName = 'basicAuthUserName'; // The username to use with basic authentication
$basicAuthPassword = 'basicAuthPassword'; // The password to use with basic authentication

$client = new MessageMediaConversationsLib\MessageMediaConversationsClient($basicAuthUserName, $basicAuthPassword);
$appUsers = $client->getAppUsers();
$appUserId = 'appUserId';
$body = new BaseMessageDto({"key":"value"});

$appUsers->createSendMessage($appUserId, $body);

📕 Documentation

Check out the full API documentation for more detailed information.

😕 Need help?

Please contact developer support at developers@messagemedia.com or check out the developer portal at developers.messagemedia.com

📃 License

Apache License. See the LICENSE file.

统计信息

  • 总下载量: 5
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 2
  • Watchers: 4
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-10-17

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固