unisender-dev / unisender

unisender API wrapper

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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.

Installation

If you use bundler then add this

gem 'uni_sender', :git => https://github.com/sharkzp/unisender.git

Getting Started

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

Dependencies

That gem supports ruby 2.1+

Wikis

For more information about actions and returned answers please visit:

About

unisender API wrapper


Languages

Language:Ruby 100.0%