Skip to content

Problem with EPO credentials #170

@deg

Description

@deg

I've moved past my earlier false alarm in #160 but now have a similar problem with the EPO API.

patent_client._sync.epo.ops.session.OpsAuthenticationError: Failed to authenticate with EPO OPS! Please check your credentials. See the setup instructions at https://patent-client.readthedocs.io/en/stable/getting_started.html

I do have the credentials set correctly, I think:

>>> os.environ["PATENT_CLIENT_EPO_API_KEY"]
'2pwQ_ELIDED_VBTl4'
>>> os.environ["PATENT_CLIENT_EPO_SECRET"]
'pJA__ELIDED__WHH'

I've also successfully called the EPO API directly with code like

    auth_url = "https://ops.epo.org/3.2/auth/accesstoken"
    response = requests.post(
        auth_url,
        auth=HTTPBasicAuth(client_id, client_secret),
        data={"grant_type": "client_credentials"},
    )

    if response.status_code == 200:
        token = response.json().get("access_token")
        return token
...
    base_url = (
        "https://ops.epo.org/3.2/rest-services/published-data/publication/epodoc/"
    )
    headers = {"Authorization": f"Bearer {access_token}", "Accept": "application/json"}
    response = requests.get(base_url + publication_number, headers=headers)

I assume this is my operator error again, but I don't see where.

Do I have the correct keys? developers.epo.org tells me that I have a "consumer key" and consumer secret key". Are these the same thing as the EPO OPS API keys that your API needs? Or do I need to get a different set?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions