Forum: Problem in V3 search in yahoo shopping

Db802d5fad77c1e4f9c14bef9b87865c?d=identicon&s=25 Asit Katiyar (asitk)
on 2007-09-21 11:36
Hi all,

I am trying to implement the yahoo shopping apis in my application. I am
trying to get the response using the XMLSimple. I am getting proper
result for the V1 and V2 product search. But V3 product search is not
working at all. Every time it give the error of "Invalid User Agent". My
code snippet is:

url =
    appid = 'xxxxxxxxxx'
    post_args =
      'appid' => appid,
      'department' => sindex,
      'query' => ipod,
      'start' => 1,
      'results' =>25,
    xml_data = Net::HTTP.post_form(url,post_args).body
    data = XmlSimple.xml_in(xml_data)
    return data

and the error message I am getting is:

<?xml version="1.0" encoding="utf-8"?>
<Error xmlns="urn:yahoo:api"
The following errors were detected:
<Message>User-agent not valid</Message>

I also tried with appending the user agent string in the request url
like this:

'User-Agent' => 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US;
rv: Gecko/20060111 Firefox/'

But It didn't work. Please help me sorting out this issue. It is
blocking the flow of the application.

Thanks in advance.
Please log in before posting. Registration is free and takes only a minute.
Existing account

NEW: Do you have a Google/GoogleMail, Yahoo or Facebook account? No registration required!
Log in with Google account | Log in with Yahoo account | Log in with Facebook account
No account? Register here.