Welcome to the Kelkoo Group Customer Service

Signing URL – Ruby

In order to access the service, you’ll need first to “sign” your URLs.

Variables

Name Type Summary
url_domain string (required) URL of the service (ex: http://uk.shoppingapis.kelkoo.com)
url_path string (required) Path and query for the service (ex: /V3/productSearch?query=ipod)
partner string (required) Affiliate Id
key string (required) Affiliate secret key

Please note that your query must be encoded if you use characters with accents.

Sample Class

 

require 'digest/md5'
 require 'base64'
 require 'uri'
def url_signer (url_domain, url_path, partner, key)
url_sig = "hash"
# replace " " by "+"
url_path.gsub(' ','+')
# format URL
url = url_path + "&aid=" + partner + "&timestamp=" + Time.now.to_i.to_s
# URL needed to create the tokken
s = url + key;
md5_str_tokken = Digest::MD5.digest(s)
md5_byte_tokken = md5_str_tokken.unpack('H*')
base64_tokken = Base64.encode64(md5_str_tokken);
base64_tokken.gsub!('+','.')
base64_tokken.gsub!('/','_')
base64_tokken.gsub!('=','-')
url = url_domain + url + "&hash=" + base64_tokken
end

Simply call the function to generate the appropriate URL:

 url_signer("http://ru.shoppingapis.kelkoo.com", "/V3/productSearch?query="+URI.escape("Мода"), "123", "PartnerKey")