HTTP 500 error when calling the API with Ajax

This space is made available to users of Open Patent Services (OPS) web-service and now also to users of EPO’s bulk data subscription products such as 14. EPO worldwide bibliographic database (DOCDB), 14.11 EPO worldwide legal status database (INPADOC), 14.12 EP full text data, 14.1 EP bibliographic data (EBD)and more.

Users can ask each other questions, exchange experiences and solutions, post ideas. The moderator will use this space to announce changes or other relevant information.
Post Reply

albin
Posts: 1
Joined: Fri Mar 11, 2016 1:16 pm

HTTP 500 error when calling the API with Ajax

Post by albin » Fri Mar 11, 2016 1:27 pm

Hi,

Trying to fetch EP information by Ajax call on my upcoming webpage, but get error. I've tried with and without Authorization with no success.


Approach 1:

$.ajax({
url: 'http://ops.epo.org/3.1/rest-services/pu ... 325/biblio',
type: 'GET',
dataType: 'json',
success: function() { alert('hello!'); },
error: function() { alert('boo!'); },
beforeSend: setHeader
});

function setHeader(xhr) {
xhr.setRequestHeader('Authorization', 'Bearer xxxx');
xhr.setRequestHeader('X-Target-URI', 'http://ops.epo.org');
xhr.setRequestHeader('Accept', 'application/json');
}

Approach 2:

$.getJSON("http://ops.epo.org/3.1/rest-services/pu ... 325/biblio", function (data)
{
if (data.length > 0) {
alert("YES");
} else {
alert("no");
}

Response output:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<fault xmlns="http://ops.epo.org">
<code>SERVER.Forbidden</code>
<message>An unknown error occurred. Please contact Open Patent Services Team (open-patent-services-and-publication-se ... )</message>
</fault>


Perhaps you know my misstake or the root cause?

Best regards,
Albin


EPO / OPS Support
Posts: 1039
Joined: Thu Feb 22, 2007 5:32 pm

Re: HTTP 500 error when calling the API with Ajax

Post by EPO / OPS Support » Mon Mar 14, 2016 9:45 am

Hi,

Did you already had a look at our document: http://documents.epo.org/projects/babyl ... 1_0_en.pdf?

Regards,
OPS support


andrewgoldberg
Posts: 4
Joined: Fri Mar 04, 2016 12:51 am

Re: HTTP 500 error when calling the API with Ajax

Post by andrewgoldberg » Wed Apr 20, 2016 12:26 am

Hello,

Do you get a 500 when you make the request using the Developers console? https://developers.epo.org/


Post Reply