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 ([email protected]).
Run the following command to install the SDK via pip:
pip install messagemedia-conversations-sdk
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.
from message_media_conversations.message_media_conversations_client import MessageMediaConversationsClient
# Configuration parameters and credentials
basic_auth_user_name = 'basic_auth_user_name' # The username to use with basic authentication
basic_auth_password = 'basic_auth_password' # The password to use with basic authentication
client = MessageMediaConversationsClient(basic_auth_user_name, basic_auth_password)
configuration_controller = client.configuration
body_value = "{ \"name\": \"Rainbow Serpent Festival\", \"callback_url\": \"https://callback.url.com\"}"
body = json.loads(body_value)
result = configuration_controller.create_configure_account(body)
from message_media_conversations.message_media_conversations_client import MessageMediaConversationsClient
# Configuration parameters and credentials
basic_auth_user_name = 'basic_auth_user_name' # The username to use with basic authentication
basic_auth_password = 'basic_auth_password' # The password to use with basic authentication
facebook_controller = client.facebook
result = facebook_controller.get_facebook_authorisation_url()
from message_media_conversations.message_media_conversations_client import MessageMediaConversationsClient
# Configuration parameters and credentials
basic_auth_user_name = 'basic_auth_user_name' # The username to use with basic authentication
basic_auth_password = 'basic_auth_password' # The password to use with basic authentication
facebook_controller = client.facebook
result = facebook_controller.get_facebook_pages()
You can get the facebookPageId by looking at the response of the Get Facebook pages example.
from message_media_conversations.message_media_conversations_client import MessageMediaConversationsClient
# Configuration parameters and credentials
basic_auth_user_name = 'basic_auth_user_name' # The username to use with basic authentication
basic_auth_password = 'basic_auth_password' # The password to use with basic authentication
facebook_controller = client.facebook
facebook_page_id = 'facebookPageId'
facebook_controller.create_integrate_facebook_page(facebook_page_id)
from message_media_conversations.message_media_conversations_client import MessageMediaConversationsClient
# Configuration parameters and credentials
basic_auth_user_name = 'basic_auth_user_name' # The username to use with basic authentication
basic_auth_password = 'basic_auth_password' # The password to use with basic authentication
app_users_controller = client.app_users
result = app_users_controller.get_app_users()
from message_media_conversations.message_media_conversations_client import MessageMediaConversationsClient
# Configuration parameters and credentials
basic_auth_user_name = 'basic_auth_user_name' # The username to use with basic authentication
basic_auth_password = 'basic_auth_password' # The password to use with basic authentication
app_users_controller = client.app_users
app_user_id = 'appUserId'
result = app_users_controller.get_app_user_by_id(app_user_id)
You can get the appUserId from the response of the Get users example.
from message_media_conversations.message_media_conversations_client import MessageMediaConversationsClient
# Configuration parameters and credentials
basic_auth_user_name = 'basic_auth_user_name' # The username to use with basic authentication
basic_auth_password = 'basic_auth_password' # The password to use with basic authentication
app_users_controller = client.app_users
app_user_id = 'appUserId'
result = app_users_controller.get_app_user_messages(app_user_id)
You can get the appUserId from the response of the Get users example.
from message_media_conversations.message_media_conversations_client import MessageMediaConversationsClient
# Configuration parameters and credentials
basic_auth_user_name = 'basic_auth_user_name' # The username to use with basic authentication
basic_auth_password = 'basic_auth_password' # The password to use with basic authentication
app_users_controller = client.app_users
app_user_id = 'appUserId'
message = BaseMessageDto({"key":"value"})
result = app_users_controller.create_send_message(app_user_id, body)
Check out the full API documentation for more detailed information.
Please contact developer support at [email protected] or check out the developer portal at developers.messagemedia.com
Apache License. See the LICENSE file.