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 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 -> emv.login;
-
Logout -> emv.logout;
-
Check status -> emv.connected?;
Method list can be found @ emvapi.emv3.com/apiccmd/services/rest?_wadl&_type=xml
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