Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

not_authenticated #1

Open
AlbiRadtke opened this issue Sep 4, 2023 · 0 comments
Open

not_authenticated #1

AlbiRadtke opened this issue Sep 4, 2023 · 0 comments

Comments

@AlbiRadtke
Copy link

Hey guys,

I would like to connect via API. For this I have run the installation with:
pip install git+https://github.com/openlegaldata/oldp-sdk-python.git

Then I copied your "Getting Started" example and replaced 'YOUR_API_KEY' with mine:

from __future__ import print_function
import time
import oldp_client
from oldp_client.rest import ApiException
from pprint import pprint

# Configure API key authorization: api_key
configuration = oldp_client.Configuration()
configuration.api_key['Authorization'] = 'MY_api_key'
# configuration.api_key_prefix['Authorization'] = 'Bearer'

# create an instance of the API class
api_instance = oldp_client.AnnotationLabelsApi(oldp_client.ApiClient(configuration))
data = oldp_client.AnnotationLabel(name="Fein", slug="muh") # AnnotationLabel |

try:
    api_response = api_instance.annotation_labels_create(data)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AnnotationLabelsApi->annotation_labels_create: %s\n" % e)

When I start the program now, 2 error messages come up immediately:

  • name and slug are missing in oldp_client.AnnotationLabel
    According to the documentation these values should be filled with "Verbose name, e.g. This Awesome annotation" and "Identifier, e.g. this-awesome-annotation".
    Could you flesh this out a bit in the example? I don't understand what is meant by this.
    When I enter anything for name and slug I get the following response:
Exception when calling AnnotationLabelsApi->annotation_labels_create: (401)
Reason: Unauthorized
HTTP response headers: HTTPHeaderDict({'Server': 'nginx/1.10.3', 'Date': 'Mon, 04 Sep 2023 14:39:43 GMT', 'Content-Type': 'application/json', 'Content-Length': '61', 'Connection': 'keep-alive', 'Vary': 'Accept, Accept-Language, Cookie', 'Content-Language': 'de', 'X-Frame-Options': 'SAMEORIGIN', 'WWW-Authenticate': 'Token', 'Allow': 'GET, POST, HEAD, OPTIONS'})
HTTP response body: {"message":"Anmeldedaten fehlen.","code":"not_authenticated"}

And where exactly can I enter my question to openlegaldata in the example?

Thank you very much :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant