Page 1 of 1

HTTP 500 error when calling the API with Ajax

Posted: Fri Mar 11, 2016 1:27 pm
by albin
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

Re: HTTP 500 error when calling the API with Ajax

Posted: Mon Mar 14, 2016 9:45 am
by EPO / OPS Support
Hi,

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

Regards,
OPS support

Re: HTTP 500 error when calling the API with Ajax

Posted: Wed Apr 20, 2016 12:26 am
by andrewgoldberg
Hello,

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