Skip to content

Latest commit

 

History

History
77 lines (53 loc) · 2.99 KB

README.rdoc

File metadata and controls

77 lines (53 loc) · 2.99 KB

gupshup

DESCRIPTION:

gupshup is a Ruby wrapper for the HTTP APIs provided by SMS GupShup which is a Group SMS Platform for the enterprises with advanced features such as masks, keywords, text/flash/vcard/bulk messages, advertising and keyword campaigns and so on.

Documentation of HTTP APIs is available here: enterprise.smsgupshup.com/doc/GatewayAPIDoc.pdf

FEATURES:

  • V 0.2.0 Return boolean status instead of raising exceptions. API_URL is now configurable.

  • V 0.1.5 Added group_post method and a generic call_api method. All methods now expect a hash of API params instead if individual arguments

  • V 0.1.2 Bulk file upload implemented. Only CSV format supported for now.

  • V 0.1.0 send_vcard and send_unicode_message implemented. Error checking.

  • V 0.0.5 send_text_message and send_flash_message are implemented

  • V 0.0.1 send_message is implemented.

USAGE:

# "target_phone_number" should be a 12 digit Indian mobile number starting with "91" (either integer or string)

gup = Gupshup::Enterprise.new(:userid => 'your_gupshup_login', :password => 'your_password')

#send a normal text message
gup.send_text_message(:msg => 'sms message text', :send_to => '91xxxxxxxxxx')

#flash messages appear on mobile's screen immediately but may not be saved on some handsets
gup.send_flash_message(:msg => 'sms message text', :send_to => '91xxxxxxxxxx')

#send a contact in VCARD format
vcard = "BEGIN:VCARD\r\nVERSION:1.2\r\nN:ICICI\r\nTEL:18002098888\r\nEND:VCARD"
gup.send_vcard(:msg => vcard, :send_to => '91xxxxxxxxxx')

#send a non-english message with a hex-encoded UTF-8 string
gup.send_unicode_message(:msg => "\xE0\xA4\x97\xE0\xA4\xAA\xE0\xA4\xB6\xE0\xA4\xAA", :send_to => '91xxxxxxxxxx') # will send "gupshup" in Devnagari script

#Upload a CSV file for bulk messages
gup.bulk_file_upload(file_path)

REQUIREMENTS:

  • httpclient

INSTALL:

sudo gem install gupshup

LICENSE:

(The MIT License)

Copyright © 2010 Nilesh Trivedi

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ‘Software’), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED ‘AS IS’, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.