Cannot retrieve data after obtaining token

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

srlapides
Posts: 4
Joined: Mon Mar 03, 2014 5:02 pm

Cannot retrieve data after obtaining token

Post by srlapides » Tue Mar 04, 2014 5:25 pm

I am able to retrieve the XML for an access token using the following VB6 code:
With http
.HTTPPostOption = "POST"
.Inputs.Add "client_credentials", "grant_type"
Call .SetRequestHeader("Authorization", ... my encoded key ...)
.URL = ..../3.1/auth/accesstoken" 'Circumvent the forum's "too spamy" msg
sHTML = .SendRequest()
End With

But when I try to provide the access token (extracted from the XML returned by the previous) in the next call using this code:
With http
.HTTPPostOption = "GET"
Call .SetRequestHeader("Authorization", ... my access token ...)
.URL = .../3.1/rest-services/published-data/publication/docdb/CO5540388/biblio" 'Circumvent the forum's "too spamy" msg

sHTML = .SendRequest()
Return
End With

What gets returned is <error><code>500</code><message>InvalidAccessToken</message></error>


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

Re: Cannot retrieve data after obtaining token

Post by EPO / OPS Support » Wed Mar 05, 2014 11:11 am

Dear user,

Could it be that you either misspelled something in access tocken or possibly did not use "Bearer"?? Please check carefully OPS documentation again.

Kind regards,

OPS support


srlapides
Posts: 4
Joined: Mon Mar 03, 2014 5:02 pm

Re: Cannot retrieve data after obtaining token

Post by srlapides » Wed Mar 05, 2014 9:04 pm

That fixed it. I was thrown off by the documentation for getting the AccessToken (page 41) where it said the AuthorizationHeader is Basic followed by the encoded Consumer key. That call works without the 'Basic'. Should that documentation be corrected?


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

Re: Cannot retrieve data after obtaining token

Post by EPO / OPS Support » Thu Mar 06, 2014 1:53 pm

Dear user,

You should have been looking at example on page 42 and not 41. 41 was for POST and you wanted GET
See attached:

Kind regards,

OPS support
Attachments
token.png
token.png (21.15 KiB) Viewed 952 times


Post Reply