openlegaldata / oldp-sdk-python Goto Github PK
View Code? Open in Web Editor NEWPython SDK for accessing the Open Legal Data API
Python SDK for accessing the Open Legal Data API
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:
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 :)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.