Date: Fri, 29 Mar 2024 06:52:42 +0000 (UTC) Message-ID: <287003167.21.1711695162975@e89e1969b9fa> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_20_1969074887.1711695162974" ------=_Part_20_1969074887.1711695162974 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html
This is the reference for the Legalinc= REST API which provides= a convenient way to create web and desktop applications that integrate wit= h the services your business provides online. The API will allow you to sub= mit orders, upload documents, and receive update notifications. HTTP respon= se codes are used to indicate API errors. JSON is returned for all response= s, and headers must be in JSON format for any methods used.
The best way to get started with the Legalinc API is to POST an order wh= ich is one of the most robust calls you can make with the API. The Orders o= bject will provide you with insight into many of the other objects th= at represent the services you provide to your clients. The documentation he= re will describe how you can also call these objects independently outside = of an order. To POST an order, go to Orders for more information.
User authentication is implemented via OAuth 2.0 with an access token tha= t gets passed in the request. You will need to enter a client_secret key as= part of setting up your authentication which you can generate in your dash= board under Developer Settings. You will also need to enter your username= span> and password when creating the= access token. If at any time you feel this information has been compromise= d, you have the ability to change the password of the API User.
After you receive your access token you must pass it with any API reques= ts that are not public.
You can pass the access token as a parameter in the header or in the que= ry string on any subsequent API calls.
The header will look like this: 'Authorization' =3D> "Bearer #{@access_token}"
Refer to Generating the Access Toke= n for more details on how to obtain the access token.
Pagination is available for the Orders object and the following paramete= rs can be used with pagination.
Parameter | |
---|---|
length | Defines the number of orders to be passed |
start | Starting point in the index |
sortColumn |
Possible values:
|
sortOrder |
Possible values:
|
Sample request with pagination and sorting: https://orders-uat.legalinc.com/api/v1/orders?pagination= =3Dtrue&length=3D2&start=3D0&sortColumn=3Did&sortOrder=3Das= c
The Legalinc REST API uses standard HT= TP status codes including the following:
Status code | Message |
---|---|
200 |
OK Standard response for successful HTTP requests. |
400 |
Bad Request Possible reason: the request cannot be fulfilled due to bad syntax o= r the access token is missing. |
401 |
Unauthorized Possible reason: user is not authorized or token is expired. |
404 |
Not Found Possible reason: incorrect URL. |
500 |
Internal Server Error Server has encountered a situation it doesn't know how to handle. |
<= a href=3D"/wiki/pages/resumedraft.action?draftId=3D221380652#Introduction-b= acktotop" data-linked-resource-id=3D"221020212" data-linked-resource-versio= n=3D"1" data-linked-resource-type=3D"page">back to top
Responses that return an error status = code (ex. 400 status code) will also return a response body, similar to the= following:
{ "error": "invalid_request", "error_description": "The request is missing a required parameter, includ= es an invalid parameter value, includes a parameter more than once, or is o= therwise malformed. Check the \"access token\" parameter." }
A successful response will return data from the request as well as the s= tatus code and message inside the same response n= ode as exemplified below.
{ "response": "{data objects ... "message": "The requested operation successfully completed", "code": 200, "success": true }
Wherever possible, examples are provid= ed throughout the documentation.
Some responses can be lengthy due to t= he objects they return, these examples are collapsed in the documentation. = Click the Expand source link to view these respon= ses. Click Collapse source to collapse the exampl= e again.
You may access a collection of request= s in Postman to run as examples. To access the collection, click the &nbs= p;button when you see it on a page. You will need to use a valid access tok= en to see the results in the UAT environment. Refer to the Generating the Access Token topic for more informa= tion.