Page 1 of 1

Invalid Access Token

Posted: Tue Oct 28, 2014 12:10 pm
by htorry
Hi, I'm getting an error when I try to use the registered service.

I can generate an access token using this pastebin com/g24sPFP0 (This is a pastebin code)

I then add the header to my request;

Code: Select all

    $headers = array(
      'Authorization: Bearer' . $access_token,
    );
    curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
Although I get this error.

Code: Select all

[Tue Oct 28 11:03:20 2014] [error] [client 192.168.1.26] PHP Fatal error:  Uncaught exception 'Pest_BadRequest' with message '<error><code>400</code><message>invalid_access_token</message><description>Access token is invalid</description>\n\t\t\t\t</error>\n\t\t\t' in /mnt/apshared/webtest/html/lib/pest/Pest.php:218\nStack trace:\n#0 /mnt/apshared/webtest/html/lib/pest/Pest.php(200): Pest->checkLastResponseForError()\n#1 /mnt/apshared/webtest/html/lib/pest/Pest.php(63): Pest->doRequest(Resource id #15)\n#2 /mnt/apshared/webtest/html/epo.class.php(53): Pest->get('/number-service...', '4K3Kyk5Uv2se6Ia...')\n#3 /mnt/apshared/webtest/html/epo.class.php(278): epo->OriginalDocument('GB2483636')\n#4 /mnt/apshared/webtest/html/epo.class.php(567): epo->call('GB2483636')\n#5 /mnt/apshared/webtest/html/search_citations_summary.php(39): epo->get_summary('GB2483636')\n#6 {main}\n  thrown in /mnt/apshared/webtest/html/lib/pest/Pest.php on line 218, referer: localwebserverremoved/
I have attempted to make the request within a few seconds of generating a new access token. Any ideas as to what to try next?

Thanks,
Harry

Re: Invalid Access Token

Posted: Wed Oct 29, 2014 7:28 am
by EPO / OPS Support
Dear user,

I suggest that you should have a look at OPS user documentation available here: http://www.epo.org/searching/free/ops/d ... ation.html

There you will find information how to obtain a token and how to incorporate it in your request header.

Kind regards,
OPS support

Re: Invalid Access Token

Posted: Wed Oct 29, 2014 11:22 am
by htorry
Hi,

I can generate an access token and it is being added into the request header although the service is still returning an invalid access token error.

Thanks,
Harry

Re: Invalid Access Token

Posted: Wed Oct 29, 2014 1:24 pm
by EPO / OPS Support
I would suggest that you send us your user name for OPS registered account to our email address and we will try to have a look at this here. I could not see how you incorporate the token in your example below, what you gave us looks like empty Auth Bearer. Please send me exact copy/example of your URL request, header and system response over email.

You have our email address in the account activation email that you've got when you registered to OPS. If not, let me know and I will send it to you via Private Message here.

Kind regards,
OPS support