question

hartre_37_deprecated_36e3f50c-5946-4529-9d76-f28f2d3c233f avatar image
0 Likes"

Issues with Ebay Search API.

I had been using ebay search API in my application for quite some time now. But in the past month or so, the API has stopped working. Below is the code for the Ajax call that I make: $.ajax({ url : url, //jsonp : false, dataType : 'jsonp', success : function(data) { .... }, error: function{ .... } }); The "jsonp: 'false'" has been commented out because initially, I did not need this line but ever since it stopped working, I searched online and realized that if I don't do jsonp: false, then a 'callback' parameter is added to my 'url' which leads the API to return a 404 URL Not Found Error. I even tried using 'jsonpCallback: myCallbackFunc' in my Ajax query parameter, still no use. The main issue is that if I don't use 'jsonp', then I get a CORS error. So I *have* to use jsonp. Now if I don't use 'jsonp: false', I get 404 from Ebay, so I *have* to use that. When I just enter the 'url' in my browser, I am able to see the results from the API. I'm pretty sure it's a CORS-jsonp related issue and I've spent about a month trying to figure it out. Any help is appreciated. Thanks :)
search-apisearch-listings
10 |600

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

1 Answer

·
hartre_37 avatar image
0 Likes"
hartre_37 answered
PS: When I use 'jsonp: false' then I get Status 200 OK response from server but the Ajax call still goes into error callback function and in console I see a warning: "CORB(Cross-Origin Reading Blocked) disabled cross-origin response .... MIME type text/plain." Even in the Network tab in Chrome Dev Console, the request status is 200, but the response body is empty! When I just manually enter the URL in my browser, I get a proper response from the API but not in the AJAX call.
10 |600

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.