0.1.0 • Published 5 years ago

oldp-api v0.1.0

Weekly downloads
1
License
MIT License
Repository
-
Last release
5 years ago

oldp-api

OldpApi - JavaScript client for oldp-api With the Open Legal Data API you can access various data from the legal domain, e.g. law text or case files. The data may be used for semantic analysis or to create statistics. For more information visit our website. https://openlegaldata.io/ This SDK is automatically generated by the Swagger Codegen project:

  • API version: v1
  • Package version: v1
  • Build package: io.swagger.codegen.languages.JavascriptClientCodegen

Installation

For Node.js

npm

To publish the library as a npm, please follow the procedure in "Publishing npm packages".

Then install it via:

npm install oldp-api --save
Local development

To use the library locally without publishing to a remote npm registry, first install the dependencies by changing into the directory containing package.json (and this README). Let's call this JAVASCRIPT_CLIENT_DIR. Then run:

npm install

Next, link it globally in npm with the following, also from JAVASCRIPT_CLIENT_DIR:

npm link

Finally, switch to the directory you want to use your oldp-api from, and run:

npm link /path/to/<JAVASCRIPT_CLIENT_DIR>

You should now be able to require('oldp-api') in javascript files from the directory you ran the last command above from.

git

If the library is hosted at a git repository, e.g. https://github.com/openlegaldata/oldp-sdk-javascript then install it via:

    npm install openlegaldata/oldp-sdk-javascript --save

For browser

The library also works in the browser environment via npm and browserify. After following the above steps with Node.js and installing browserify with npm install -g browserify, perform the following (assuming main.js is your entry file, that's to say your javascript file where you actually use this library):

browserify main.js > bundle.js

Then include bundle.js in the HTML pages.

Webpack Configuration

Using Webpack you may encounter the following error: "Module not found: Error: Cannot resolve module", most certainly you should disable AMD loader. Add/merge the following section to your webpack config:

module: {
  rules: [
    {
      parser: {
        amd: false
      }
    }
  ]
}

Getting Started

Please follow the installation instruction and execute the following JS code:

var OldpApi = require('oldp-api');

var defaultClient = OldpApi.ApiClient.instance;

// Configure API key authorization: api_key
var api_key = defaultClient.authentications['api_key'];
api_key.apiKey = "YOUR API KEY"
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key.apiKeyPrefix['Authorization'] = "Token"

var api = new OldpApi.AnnotationLabelsApi()

var data = new OldpApi.AnnotationLabel(); // {AnnotationLabel} 


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.annotationLabelsCreate(data, callback);

Documentation for API Endpoints

All URIs are relative to https://de.openlegaldata.io/api

ClassMethodHTTP requestDescription
OldpApi.AnnotationLabelsApiannotationLabelsCreatePOST /annotation_labels/
OldpApi.AnnotationLabelsApiannotationLabelsDeleteDELETE /annotation_labels/{id}/
OldpApi.AnnotationLabelsApiannotationLabelsListGET /annotation_labels/
OldpApi.AnnotationLabelsApiannotationLabelsPartialUpdatePATCH /annotation_labels/{id}/
OldpApi.AnnotationLabelsApiannotationLabelsReadGET /annotation_labels/{id}/
OldpApi.AnnotationLabelsApiannotationLabelsUpdatePUT /annotation_labels/{id}/
OldpApi.CaseAnnotationsApicaseAnnotationsCreatePOST /case_annotations/
OldpApi.CaseAnnotationsApicaseAnnotationsDeleteDELETE /case_annotations/{id}/
OldpApi.CaseAnnotationsApicaseAnnotationsListGET /case_annotations/
OldpApi.CaseAnnotationsApicaseAnnotationsPartialUpdatePATCH /case_annotations/{id}/
OldpApi.CaseAnnotationsApicaseAnnotationsReadGET /case_annotations/{id}/
OldpApi.CaseAnnotationsApicaseAnnotationsUpdatePUT /case_annotations/{id}/
OldpApi.CaseMarkersApicaseMarkersCreatePOST /case_markers/
OldpApi.CaseMarkersApicaseMarkersDeleteDELETE /case_markers/{id}/
OldpApi.CaseMarkersApicaseMarkersListGET /case_markers/
OldpApi.CaseMarkersApicaseMarkersPartialUpdatePATCH /case_markers/{id}/
OldpApi.CaseMarkersApicaseMarkersReadGET /case_markers/{id}/
OldpApi.CaseMarkersApicaseMarkersUpdatePUT /case_markers/{id}/
OldpApi.CasesApicasesCreatePOST /cases/
OldpApi.CasesApicasesDeleteDELETE /cases/{id}/
OldpApi.CasesApicasesListGET /cases/
OldpApi.CasesApicasesPartialUpdatePATCH /cases/{id}/
OldpApi.CasesApicasesReadGET /cases/{id}/
OldpApi.CasesApicasesSearchListGET /cases/search/
OldpApi.CasesApicasesUpdatePUT /cases/{id}/
OldpApi.CitiesApicitiesListGET /cities/
OldpApi.CitiesApicitiesReadGET /cities/{id}/
OldpApi.CountriesApicountriesListGET /countries/
OldpApi.CountriesApicountriesReadGET /countries/{id}/
OldpApi.CourtsApicourtsListGET /courts/
OldpApi.CourtsApicourtsReadGET /courts/{id}/
OldpApi.LawBooksApilawBooksCreatePOST /law_books/
OldpApi.LawBooksApilawBooksDeleteDELETE /law_books/{id}/
OldpApi.LawBooksApilawBooksListGET /law_books/
OldpApi.LawBooksApilawBooksPartialUpdatePATCH /law_books/{id}/
OldpApi.LawBooksApilawBooksReadGET /law_books/{id}/
OldpApi.LawBooksApilawBooksUpdatePUT /law_books/{id}/
OldpApi.LawsApilawsCreatePOST /laws/
OldpApi.LawsApilawsDeleteDELETE /laws/{id}/
OldpApi.LawsApilawsListGET /laws/
OldpApi.LawsApilawsPartialUpdatePATCH /laws/{id}/
OldpApi.LawsApilawsReadGET /laws/{id}/
OldpApi.LawsApilawsSearchListGET /laws/search/
OldpApi.LawsApilawsUpdatePUT /laws/{id}/
OldpApi.StatesApistatesListGET /states/
OldpApi.StatesApistatesReadGET /states/{id}/
OldpApi.TokenAuthApitokenAuthCreatePOST /token-auth/
OldpApi.UsersApiusersListGET /users/
OldpApi.UsersApiusersMeGET /users/me/
OldpApi.UsersApiusersReadGET /users/{id}/

Documentation for Models

Documentation for Authorization

api_key

  • Type: API key
  • API key parameter name: Authorization
  • Location: HTTP header