lib/tessitura_rest/web/session.rb in tessitura_rest-0.1.4 vs lib/tessitura_rest/web/session.rb in tessitura_rest-0.1.5
- old
+ new
@@ -4,9 +4,37 @@
options.merge!({:basic_auth => @auth})
response = self.class.get(base_api_endpoint("Web/Session/#{key}"), options)
JSON.parse(response.body)
end
+ def create_session(ip, options={})
+ parameters =
+ {
+ 'IpAddress': ip
+ }
+ options.merge!({:basic_auth => @auth})
+ options.merge!(:body => parameters)
+ response = self.class.post(base_api_endpoint('Web/Session'), options)
+ JSON.parse(response.body)
+ end
+
+ def get_expiration(key, options={})
+ options.merge!({:basic_auth => @auth})
+ response = self.class.get(base_api_endpoint("Web/Session/#{key}/Expiration"), options)
+ JSON.parse(response.body)
+ end
+
+ def set_expiration(key, expiration, options={})
+ parameters =
+ {
+ 'Expiration': expiration
+ }
+ options.merge!({:basic_auth => @auth})
+ options.merge!(:body => parameters)
+ response = self.class.put(base_api_endpoint("Web/Session/#{key}/Expiration"), options)
+ JSON.parse(response.body)
+ end
+
def get_promotion(key, code, options={})
parameters =
{
'PromoCode': code
}