REST API wrapper interacting with Emailvision
Ruby
Switch branches/tags
Nothing to show
Clone or download
Pull request Compare This branch is 101 commits behind basgys:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
.gitignore
Gemfile
README.rdoc
emailvision.gemspec

README.rdoc

Emailvision Gem

Emailvision is a REST API wrapper interacting with Emailvision. It :

  • Has a very comfortable syntax (ruby style);

  • Uses the “lazy loading” pattern;

  • Support further changes on Emailvision API (dynamic call);

Credentials

Credentials can be set in the environment.rb file like this:

  • EMV_LOGIN = “”

  • EMV_PASSWORD = “”

  • EMV_KEY = “”

Or when you instance your object like this: emv = Emailvision::Api.new “login”, “password”, “key”

Login/Logout

  • Login -> emv.login;

  • Logout -> emv.logout;

  • Check status -> emv.connected?;

Method calling

Method list can be found @ emvapi.emv3.com/apiccmd/services/rest?_wadl&_type=xml

Example #1

Method to call

<resource path=“campaign/last/”> <method name=“GET”> <request> <param name=“token” style=“query” type=“xs:string”/> <param name=“limit” style=“query” type=“xs:int”/> </request> <response> <representation mediaType=“application/xml”/> </response> </method> </resource>

Summary

  • Name : campaign/last

  • Method : GET

  • Parameters : token, limit

Method calling syntax

  • emv.get.campaign.last(:limit => 5).call

Explanation

  • get is the HTTP verb

  • campaign.last is the method name

  • (:limit => 5) is the parameters. token is automatically given

  • call is the keyword to perform the API call