The ruby wrapper of cloopen rest.
Add this line to your application's Gemfile:
gem 'cloopen_rest'
And then execute:
$ bundle
Or install it yourself as:
$ gem install cloopen_rest
require 'rubygems' # not necessary with ruby 1.9 but included for completeness
require 'cloopen_rest'
account_sid = 'your_account_sid'
auth_token = 'your_auth_token'
app_id = 'your_app_id'
@client = Cloopen::REST::Client.new(account_sid, auth_token, app_id)
@account = @client.account
Send a SMS (official doc)
message = @account.sms.messages.create(
to: 'your_phone_number',
body: 'text sms from gem',
sub_account_sid: 'your_sub_account_sid')
# Get the resquest response and status
message.response
message.response.body
message.response.status
message.response.status_code
Get info of the account (official doc)
info = @account.account_info.get
info.response
Make a landing call (official doc)
landing_call = @account.calls.landing_calls.create(
to: 'your_phone_number',
media_txt: 'Hello, from Gem.',
play_times: 3)
landing_call.response
Create a sub_account (official doc)
sub_account = @account.sub_accounts.create friendly_name: 'awesome_name'
sub_account.response
- Test
- More APIs
- Fork it
- 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 new Pull Request
Inspired by twilio-ruby