UniSender<img src=“https://secure.travis-ci.org/sharkzp/unisender.png?branch=master” alt=“Build Status” />¶ ↑
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', :git => https://github.com/sharkzp/unisender.git
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 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]=Роман&friend[car]=BMW
Keep in mind, that field_names and data for API method ImportContact translated different way, all this provided by gem and data translated into
field_names[0]=email&field_names[1]=email_list_ids& data[0][0]=a@example.com&data[0][1]=123&data[1][0]=b@example.org
That gem supports ruby 2.1+
For more information about actions and returned answers please visit: