Created
May 12, 2018 00:55
-
-
Save IbrahimTareq/fc382fee828774dd04b5615659884452 to your computer and use it in GitHub Desktop.
MessageMedia Messages Ruby
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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