uni_sender gem provides full dev kit to access to api of unisender.com.ua. It uses method_missing method to provide flexible functionality, so all methods will return hash that represents responce of server.
If you use bundler then add this
gem 'uni_sender'
Or you can install it via gem command
gem install uni_sender
Gem provide class UniSender::Client for accessing server’s api. For creating client you need you personal key
client = UniSender::Client.new(‘your secret key’)
Gem provides non-sensitive style, so action getLits will equal to get_lists or Get_Lists
For getting contacts call client.exportContacts(or export_clients ;) ). If request will be accepted client return hash in format
{'result'=>{'field_names'=>[...], 'data'=>[[...], [...], ... ]}
Before sent action to server gem process all parameters. If it will be String gem decode it to url standarts - no latin symbols will changed to equal codes.For example:
'Прекрасный день' will be "%D0%9F%D1%80%D0%B5%D0%BA%D1%80%D0%B0%D1%81%D0%BD%D1%8B%D0%B9%20%D0%B4%D0%B5%D0%BD%D1%8C"
If parameter are array, uni_sender will join contents by “,”(comma), also process all item like string
:sample => [233, 'foo', 545] will sample=233,foo,545
Hash will decode to variables of 2 level, for example:
:friend=>{:name=>"Роман", :car=>"BMW"} will be friend[name]=%D0%A0%D0%BE%D0%BC%D0%B0%D0%BD&friend[car]=BMW
That gem supports ruby 1.8+
For more information about actions and returned answers please visit: