MessageMedia Ruby SDK
This library provides a simple interface for sending and receiving messages using the MessageMedia SOAP API.
If you have any issue using this sample code, or would like to report a defect, you could create a new Issue in Github or Contact us.
Installation
The messagemedia-ruby Gem can be installed from Rubygems:
gem install -ruby
Usage
The following actions have been implemented:
- sendMessages
- checkUser
- checkReplies
- checkReports
- confirmReplies
- confirmReports
Initialise the client
Initialise the client using your MessageMedia username and password:
require 'messagemedia-ruby'
client = Messagemedia::SOAP::Client.new(YOUR_USERNAME, YOUR_PASSWORD)
Send Messages
To send a single message:
client.(<TO_NUMBER>, <MESSAGE>, <MESSSAGE_ID>)
To send multiple messages:
# Construct the first Message object
= Messagemedia::SOAP::Message.new
.content = "Content of Message"
.delivery_report = true
.origin = "My Company"
.add_recipient(FIRST_MESSAGE_ID, TO_NUMBER)
# Construct the second Message object
= Messagemedia::SOAP::Message.new
.content = "Content of Message"
.delivery_report = false
.origin = "My Company"
.add_recipient(SECOND_MESSAGE_ID, TO_NUMBER)
client.([, ])
Other Actions
Check out 'example.rb' in the 'bin' directory to see examples of how you can use the other actions provided by this SDK.
Contributing
We welcome contributions from our users. Contributing is easy:
- Fork this repo
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a Pull Request