question

deepocean_11k avatar image
4 Likes"
deepocean_11k asked

Finding-API returns 302 moved temporarily

Hi, my query is getting status 302 back since today, and it was working properly for a long time until this morning even. I noticed that HTTPS will be enforced, but don't know if anything else is changed / need to change from my side. I use findItemsAdvanced, and just filter for category, keyword and country. Does anyone else having similar problem? What do I need to change? Thanks!
finding-apifinditemsadvanced302
10 |600 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

kohalacoastgabe avatar image
1 Like"
kohalacoastgabe answered
Same problem, @deepocean_11 . Stable code running eBay API call for months and suddenly error 302 Using call https://svcs.ebay.com/services/search/FindingService/v1?OPERATION-NAME=findItemsAdvanced eBay: what's up?
10 |600 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

elemen7ss avatar image
0 Likes"
elemen7ss answered
Same for me, all requests are resulting in 302
10 |600 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

kohalacoastgabe avatar image
0 Likes"
kohalacoastgabe answered
Of the 50 people following this question, is anyone else seeing this too? It's weird that there wouldn't be more noise around this: eBay search API failing.... unless the OP and I are the only people seeing this? Please chime in, anyone. Thanks.
10 |600 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

clickimusprime avatar image
0 Likes"
clickimusprime answered
Working OK here. I don't see anything related to https. Provide useful information if you want help, such as a sample call and the error response. 302 is not a documented Finding API error. If the API is returning that error, there should be an error node in the response with more details. But 302 is a HTTP redirect status code. It is not an error, it is a response that provides a new URL to use. If you aren't following redirects properly, you will see this status code and a URL to follow. If your GET request works in a browser, then it's some issue in your code. Stable code can go bad if a system update changed default behavior or introduced a bug in a library or other underlying code.
10 |600 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

helios825 avatar image
0 Likes"
helios825 answered
Anyone with this issue: If you happen to be using cURL to make your API calls, be sure to set the option to follow 301/302 redirects -- set CURLOPT_FOLLOWLOCATION to TRUE. Also check: there's another option for max # of hops on the redirect, and perhaps other tweaks as well. It's in the cURL docs.
10 |600 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

kohalacoastgabe avatar image
0 Likes"
kohalacoastgabe answered
thanks @helios825 Not quite sure where to put the CURL.... in my code; I am using JQuery and an .ajax call. Here's sample code (which used to work for months) var url = " https://svcs.ebay.com/services/search/FindingService/v1?OPERATION-NAME=findItemsAdvanced&GLOBAL-ID=EBAY-US&SERVICE-VERSION=1.11.0&SECURITY-APPNAME=Zeropaid-de1b-4c29-9421-07900af71527&RESPONSE-DATA-FORMAT=json&REST-PAYLOAD&keywords=145.022&paginationInput.entriesPerPage=25&outputSelector=SellerInfo&paginationInput.pageNumber=1&categoryId=281&sortOrder=StartTimeNewest" fetchResults(url) function fetchResults(url) { console.log("fetching: ", url) $.ajax({ url: url, dataType: "jsonp", jsonpCallback: "parseData", async: false, processData: false, }); return; } In Chrome Console, it complains about: Request URL: https://svcs.ebay.com/services/search/FindingService/v1?OPERATION-NAME=findItemsAdvanced&GLOBAL-ID=EBAY-US&SERVICE-VERSION=1.11.0&SECURITY-APPNAME=Zeropaid-de1b-4c29-9421-07900af71527&RESPONSE-DATA-FORMAT=json&REST-PAYLOAD&keywords=145.022&paginationInput.entriesPerPage=25&outputSelector=SellerInfo&paginationInput.pageNumber=1&categoryId=281&sortOrder=StartTimeNewest&callback=parseData&_=1569548229937 Request Method: GET Status Code: 302 Moved Temporarily Remote Address: 66.135.211.97:443 Referrer Policy: no-referrer-when-downgrade What is totally weird is: (1) It would actually work 1 out of 100 times! (2) If you simply click on the URL itself it's trying to fetch, you do get proper JSON from eBay, so like the .ajax is somehow suddenly failing. Again, all this worked daily, stable, for many months. That's why I am so confused! Thanks
10 |600 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

kohalacoastgabe avatar image
0 Likes"
kohalacoastgabe answered
By the way, found this: https://airbrake.io/blog/http-errors/302-found The explanation suggests something is wrong w eBay's servers -- not something any of us are doing wrong. The explanation suggests some configuration issue w. eBay's Apache or nginx and goes thru a list of server-debugging steps. While it's reasonable that maybe there's some end-user coding tricks that could help work around, it's my impression from reading the explanation that eBay servers should not be throwing 302s that user code should then dance around. How does one make eBay aware of this? THx
10 |600 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

clickimusprime avatar image
0 Likes"
clickimusprime answered
302's are normal. They are used for redirecting requests to the proper resource. That article's claim that "302 Found indicates that something has gone wrong within the server of your application, we can largely disregard the client side of things." is complete nonsense. The link you posted is not working at all. Post it in a code block, it may be damaged by the forum. It gives a 302 to an eBay error page. Have you looked at the response you get in the browser console? Removing the callback parameters lets it go thru. Given that the website is completely rejecting it, this link either wasn't working for months or eBay recently changed the handler. Look to your jQuery and browser. You may be getting an issue related to a cross protocol switch, CORS, etc. The message indicates a cross protocol downgrade issue. Some jQuery versions had trouble with down-grading from https to http. If the 302 is redirecting to http, it could be breaking things. There are workarounds. You may not need the callback parameter. Use jsonp mode. You'll have to post the jquery code, a clean request link, and the 302 response contents to continue.
10 |600 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

kohalacoastgabe avatar image
0 Likes"
kohalacoastgabe answered
@clickimusprime, thanks for your response. I'll digest it. But it's weird you're suggesting the URL itself is somehow malformed; click on it in the code snippet earlier in the thread and it works. Here it is again, just click on the URL: var url = " https://svcs.ebay.com/services/search/FindingService/v1?OPERATION-NAME=findItemsAdvanced&GLOBAL-ID=EBAY-US&SERVICE-VERSION=1.11.0&SECURITY-APPNAME=Zeropaid-de1b-4c29-9421-07900af71527&RESPONSE-DATA-FORMAT=json&REST-PAYLOAD&keywords=145.022&paginationInput.entriesPerPage=25&outputSelector=SellerInfo&paginationInput.pageNumber=1&categoryId=281&sortOrder=StartTimeNewest" And I can absolutely sign my name to the fact that this very code has been working and stable for many months, doing hourly eBay searches for me....till I suddenly started getting error couple of days ago... Which suggests to me something on eBay's end has either broken or changed. Thx for looking & helping.
10 |600 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

clickimusprime avatar image
0 Likes"
clickimusprime answered
The link you posted earlier has a callback=parseData parameter and a cachebuster on the end.
10 |600 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.