This article is deprecated and replaced by a newer introduction to our APIv3.
Legalsense currently offers two API's both are REST(ful) APIs/webservices. The first one is named APIv1 and is slowly becoming deprecated (and being replaced by the second API). The second API is called the Legalsense REST API and is actively maintained (and expanded).
Legalsense REST API
The Legalsense API is largely 'self-documented' in the sense that the API offers a 'clickable UI' in which basic documentation of the API has been added and objects can be viewed.
The API can be found at:
https://<yourinstallation>.legalsense.nl/api/v2/
Legalsense API Authentication
Web based
In order to navigate the 'clickable' part of the API you need to log in with your Legalsense user credentials.
REST based
For authentication in your application you can get an 'auth token'.
Example to retrieve an auth token:
curl --dump-header - -H "Content-Type: application/json" -X POST --data '{
"username": "",
"password": "",
"client": ""
}' https://yourinstallation.legalsense.nl/api/v2/auth/login/
'Client' can be your own name, e.g. 'Name of Integration Partner'.
The return value is of the form:
{"auth_token":"<long string of hexadecimal digits>"}
The returned token must then be used as value in the Authorization header:
Authorization: Token <long string of hexadecimal digits>
Two Factor Authentication
Legalsense implements time based one time password tokens, TOTP for short, as a method of two factor authentication (2FA). When this extra security layer is enabled for a firm, or a user has chosen to activate this option for his/her account, a security token is required too.
To login, one simply supplies the 2FA token in the same login call, only extended with the current value of the token.
curl --dump-header - -H "Content-Type: application/json" -X POST --data '{
"username": "",
"password": "",
"token": "",
"client": ""
}' https://yourinstallation.legalsense.nl/api/v2/auth/login/
When a token is expected but not supplied, the API will return a specific error code 402, with a message saying that "Token is required."
Page size (large queries)
In most cases, the API listing is limited to 500 entries. For time entries (loglines), the limit by default is 100 entries. To get a larger listing, use the `page_size` parameter to specify a limit up to 1000 entries. In case you specify a higher limit, it will be interpreted as the maximum of 1000.
Example, to get a list of 1000 matters, use:
https://yourinstallation.legalsense.nl/api/v2/matters/?page_size=1000
APIv1
This API can be found by going to a Legalsense installation and adding `/api/v1/` to the URL.
E.g. https://<yourinstallation>.legalsense.nl/api/v1/
The API was introduced mainly to interact with Legalsense contacts, clients and matters (and related objects).
Comments
0 comments
Article is closed for comments.