Zadarma API
Installation
Add this line to your application's Gemfile:
gem 'zadarma'
And then execute:
$ bundle
Or install it yourself as:
$ gem install zadarma
Usage
Zadarma.api_key = "YOUR_API_KEY"
Zadarma.api_secret = "YOUR_API_SECRET"
Zadarma.log_requests = false # default
Zadarma::Client.balance
or
client = Zadarma::Client.new("YOUR_API_KEY", "YOUR_API_SECRET")
client.balance
Available methods:
balance
- user balanceprice(number)
- call pricecallback(from, to, params = {})
- request callbacksip
- list user’s SIP-numbersset_sip_caller(id, number)
- change of CallerIDredirection(params = {})
- get call forwarding status on SIP-numbersset_redirect(id, params)
- enable/disable sip forwardingpbx_internal
- list PBX internal numberspbx_record(id, status, params = {})
- toggle call recordingsend_sms(number, message, params = {})
- send smsstatistics(date_start, date_end, params = {})
- get statspbx_statistics(date_start, date_end)
- get PBX statsdirect_numbers
- get direct numbersdocuments_groups_list
- get document groupsdirect_numbers_available(direction_id)
- get direct numbers available for purchasedirect_numbers_countries
- get countries where numbers are availabledirect_numbers_country(country_code)
- get numbers within a given countrydirect_numbers_order(number_id, period, direction_id, documents_group_id, purpose, receive_sms, user_id)
- purchase a number
Contributing
- Fork it ( https://github.com/zhekanax/zadarma-ruby/fork )
- 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 new Pull Request