diff --git a/HISTORY b/HISTORY index 1ffc45a..cd01ca6 100644 --- a/HISTORY +++ b/HISTORY @@ -1,3 +1,6 @@ +=== 4.5.1 2025-04-07 +- Fix Verification URLs + === 4.5.0 2024-05-16 - Support for warnings in Events API diff --git a/lib/sift.rb b/lib/sift.rb index a9c656f..adc93c8 100644 --- a/lib/sift.rb +++ b/lib/sift.rb @@ -10,17 +10,17 @@ def self.rest_api_path(version=API_VERSION) end # Returns the path for the specified API version - def self.verification_api_send_path(version=API_VERSION) + def self.verification_api_send_path(version=VERIFICATION_API_VERSION) "/v#{version}/verification/send" end # Returns the path for the specified API version - def self.verification_api_resend_path(version=API_VERSION) + def self.verification_api_resend_path(version=VERIFICATION_API_VERSION) "/v#{version}/verification/resend" end # Returns the path for the specified API version - def self.verification_api_check_path(version=API_VERSION) + def self.verification_api_check_path(version=VERIFICATION_API_VERSION) "/v#{version}/verification/check" end diff --git a/lib/sift/client.rb b/lib/sift/client.rb index f7a5837..b510ae3 100644 --- a/lib/sift/client.rb +++ b/lib/sift/client.rb @@ -139,6 +139,7 @@ def initialize(opts = {}) @api_key = opts[:api_key] || Sift.api_key @account_id = opts[:account_id] || Sift.account_id @version = opts[:version] || API_VERSION + @verification_version = opts[:verification_version] || VERIFICATION_API_VERSION @timeout = opts[:timeout] || 2 # 2-second timeout by default @path = opts[:path] || Sift.rest_api_path(@version) @@ -201,7 +202,7 @@ def user_agent # # :path:: # Overrides the URI path for this API call. - # + # # :include_score_percentiles:: # include_score_percentiles(optional) : Whether to add new parameter in the query parameter. # @@ -286,7 +287,7 @@ def track(event, properties = {}, opts = {}) # # :version:: # Overrides the version of the Events API to call. - # + # # :include_score_percentiles:: # include_score_percentiles(optional) : Whether to add new parameter in the query parameter. # @@ -350,7 +351,7 @@ def score(user_id, opts = {}) # # :timeout:: # Overrides the timeout (in seconds) for this call. - # + # # :include_score_percentiles:: # include_score_percentiles(optional) : Whether to add new parameter in the query parameter. # @@ -755,7 +756,7 @@ def build_default_headers_post(api_key) def verification_send(properties = {}, opts = {}) api_key = opts[:api_key] || @api_key - version = opts[:version] || @version + version = opts[:verification_version] || @verification_version timeout = opts[:timeout] || @timeout raise("properties cannot be empty") if properties.empty? @@ -767,14 +768,13 @@ def verification_send(properties = {}, opts = {}) :headers => build_default_headers_post(api_key) } options.merge!(:timeout => timeout) unless timeout.nil? - response = self.class.post(Sift.verification_api_send_path(@version), options) Response.new(response.body, response.code, response.response) end def verification_resend(properties = {}, opts = {}) api_key = opts[:api_key] || @api_key - version = opts[:version] || @version + version = opts[:verification_version] || @verification_version timeout = opts[:timeout] || @timeout raise("properties cannot be empty") if properties.empty? @@ -793,7 +793,7 @@ def verification_resend(properties = {}, opts = {}) def verification_check(properties = {}, opts = {}) api_key = opts[:api_key] || @api_key - version = opts[:version] || @version + version = opts[:verification_version] || @verification_version timeout = opts[:timeout] || @timeout raise("properties cannot be empty") if properties.empty? diff --git a/lib/sift/version.rb b/lib/sift/version.rb index 6675b86..659643f 100644 --- a/lib/sift/version.rb +++ b/lib/sift/version.rb @@ -1,4 +1,5 @@ module Sift - VERSION = "4.5.0" + VERSION = "4.5.1" API_VERSION = "205" + VERIFICATION_API_VERSION = "1.1" end diff --git a/test_integration_app/verification_api/test_verification_api.rb b/test_integration_app/verification_api/test_verification_api.rb index 79eb0bd..339ebfc 100644 --- a/test_integration_app/verification_api/test_verification_api.rb +++ b/test_integration_app/verification_api/test_verification_api.rb @@ -2,13 +2,13 @@ class VerificationAPI - @@client = Sift::Client.new(:api_key => ENV["API_KEY"], :version=>1.1) + @@client = Sift::Client.new(:api_key => ENV["API_KEY"], :version => 1.1) def send() properties = { "$user_id" => $user_id, "$send_to" => $user_email, - "$verification_type" => "$email", + "$verification_type" => "$email", "$brand_name" => "MyTopBrand", "$language" => "en", "$site_country" => "IN", @@ -28,5 +28,5 @@ def send() return @@client.verification_send(properties) end - + end