Skip to content

Instantly share code, notes, and snippets.

@IbrahimTareq
Created May 12, 2018 00:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save IbrahimTareq/fc382fee828774dd04b5615659884452 to your computer and use it in GitHub Desktop.
Save IbrahimTareq/fc382fee828774dd04b5615659884452 to your computer and use it in GitHub Desktop.
MessageMedia Messages Ruby
require 'message_media_messages'
require 'pp'
# Configuration parameters and credentials
auth_user_name = 'API_KEY' # The username to use with basic/HMAC authentication
auth_password = 'API_SECRET' # The password to use with basic/HMAC authentication
use_hmac = false # Change this to true if you are using HMAC keys
client = MessageMediaMessages::MessageMediaMessagesClient.new(
auth_user_name: auth_user_name,
auth_password: auth_password,
use_hmac: use_hmac
)
messages = client.messages
body_value = '{
"messages":[
{
"content":"My first message",
"destination_number":"+61491570156"
}
]
}';
body = JSON.parse(body_value);
result = messages.create_send_messages(body)
pp result
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment