Skip to main content

API Integration

Akshat Singhal avatar
Written by Akshat Singhal
Updated over 5 months ago

This guide will walk you through the steps required to integrate our APIs into your platform, so you can start tracking cases and receiving updates.

New Cases Webhook

In the workflow of our system, we first identify new cases in the Litigation Management Tool (LMT) based on the specific keywords provided by the client. Once these cases are pinpointed, we then proceed to send a comprehensive list of these newly discovered cases directly to the client's designated API endpoint. The client's system should be configured to receive this data and subsequently store all the relevant information about these cases in their database. This streamlined process ensures that the client remains up-to-date with the latest cases of interest and allows for seamless integration of this data into their own records.

Add Case API

Within our system, clients have the flexibility to add cases they wish to track through the Litigation Management Tool (LMT) API. To do so, clients simply send the Case ID along with their unique identifier or number using the provided API. Upon receiving this information, LMT promptly processes the request and adds the specified case to the client's account, ensuring that clients can effortlessly manage and monitor the cases of their choice within the platform.

Case Update Webhook

In our system, the Litigation Management Tool (LMT) is designed to keep clients well-informed by regularly updating the status and details of their cases. When there are any updates in a client's case, LMT promptly sends these updated case details to the client's specified API Endpoint. This seamless information transfer allows the client to receive real-time data, and they can subsequently update the relevant case details within their own database, ensuring that they always have the latest and most accurate information at their fingertips for effective case management.

API & Webhook Integration

To receive new cases and updates of cases you're tracking, you need to create two endpoints on your end:

1. Endpoint to get new cases: This endpoint should be able to receive new cases pushed by our webhooks and store them in your database.

2. Endpoint to get updates of the cases you're tracking: This endpoint should be able to receive updates pushed by our webhooks and update the status of the cases you're tracking in your database.

To start tracking a new case, you need to call our Add case AP

API Reference

1. New cases Discovered API:

  • If our system identifies new cases, we will promptly notify you via your webhook. This notification includes the necessary details to seamlessly integrate these cases into your database. Below, you'll find our API response body, providing comprehensive information about each new case.

  • After receiving this information through your webhook, you can proceed to add these cases to your "All Cases" section for unified management and tracking.

Response Body:

{

'type': 'Success',

'status': 200,

'count': 24,

'docs': [

{

"id": 291676400,

"respondent": "Mangali Srinivasulu",

"complainant": "Murari Siddarth Goud",

"date_of_filing": "28 Oct 2023",

"scrape_type": 1,

"scrape_court": "District Court",

"court_name": "Iii Addl District Complex Nandyal Kurnool Andhra Pradesh",

"type_name": "MVOP - MOTOR ACCIDENT OP",

"hearing_date": "12 Mar 2024",

"disposal_date": null,

"cino": "APKU060000622024 (6/2024)",

"court_data": {

"name": "Iii Addl District Complex Nandyal Kurnool Andhra Pradesh",

"district": "Nandyal",

"state": "Andhra Pradesh"

},

"disposed": 0,

"stage": "NOTICE",

"case_status": "PENDING",

"case_no": "13 Jun 2024",

"city": "Nandyal",

"state": "Andhra Pradesh",

"case_type_id": null,

"date_of_registration": "02 Feb 2024",

"client_type": null,

"case_no_new": "13 Jun 2024"

},

{

"id": 291676400,

"respondent": "Mangali Srinivasulu",

"complainant": "Murari Siddarth Goud",

"date_of_filing": "28 Oct 2023",

"scrape_type": 1,

"scrape_court": "District Court",

"court_name": "Iii Addl District Complex Nandyal Kurnool Andhra Pradesh",

"type_name": "MVOP - MOTOR ACCIDENT OP",

"hearing_date": "12 Mar 2024",

"disposal_date": null,

"cino": "APKU060000622024 (6/2024)",

"court_data": {

"name": "Iii Addl District Complex Nandyal Kurnool Andhra Pradesh",

"district": "Nandyal",

"state": "Andhra Pradesh"

},

"disposed": 0,

"stage": "NOTICE",

"case_status": "PENDING",

"case_no": "13 Jun 2024",

"city": "Nandyal",

"state": "Andhra Pradesh",

"case_type_id": null,

"date_of_registration": "02 Feb 2024",

"client_type": null,

"case_no_new": "13 Jun 2024"

},

]

}

2. Case Details API:

With this API, you can effortlessly retrieve all-encompassing details about a case, including comprehensive information on hearings, orders, and other relevant details. By leveraging this functionality, you gain access to a holistic overview of the case, streamlining the process of obtaining comprehensive and up-to-date information.

--method : POST

--header 'access-token: <client's token>'

--header 'Content-Type: application/json'

--payload = json.dumps({

"case_id": 146694570,

})

Error Response Example:

{

"type": "Failed",

"status": 404,

"error": "Case id does not exist"

}

Success Response Example:

{

"type": "Success",

"status": 200,

"docs": {

"id": 289801478,

"court_link_id": 776,

"respondent": "STATE OF GUJARAT",

"complainant": "SAHILESHBHAI MAGANBHAI HALATI",

"date_of_filing": "12 Jan 2024",

"date_of_registration": "02 Feb 2024",

"filing_no": "SCR.A/1956/2024",

"registration_no": null,

"type_name": "SCR.A",

"court_no": null,

"court_name": "Gujarat High Court",

"year": "13 Feb 2024",

"scrape_type": 29,

"scraped_status": 1,

"first_hearing_date": null,

"last_hearing_date": "07 Feb 2024",

"court_number_and_judge": "HONOURABLE MR. JUSTICE HASMUKH D. SUTHAR",

"nature_of_disposal": null,

"is_alloted": false,

"disposal_date": null,

"ep_case_no": "F/SCR.A/1956/2024",

"hearing_date": "19 Feb 2024",

"date_of_disposal": null,

"scrape_court": "Gujarat High Court",

"alloted": null,

"hidden_complainant": "N",

"hidden_respondent": "N",

"cino": "GJHC240036022024",

"case_no": "F/SCR.A/1956/2024",

"case_no_new": "GJHC240036022024",

"case_no2": "GJHC240036022024",

"disposed": 0,

"stage": "610 - RELEASE OF MUDDAMAL CASES",

"case_status": "PENDING",

"court_link": {

"court_link": {

"id": 776,

"name": "Gujarat High Court",

"city": {

"id": 782,

"name": "Ahmedabad",

"state": {

"id": 12,

"name": "Gujarat",

"region": "W"

}

}

}

},

"court_data": {

"name": "Gujarat High Court",

"district": "Ahmedabad",

"state": "Gujarat"

},

"orders": [

{

"court_data_id": 289801478,

"order_type": "order",

"id": "1-order",

"date_of_order": "17 Jan 2024",

"order_no": 1,

"judge_name": "REGISTRAR (JUDICIAL)",

"case_no": "CR.A/1983/2024",

"description": "order - 17 Jan 2024",

"is_deleted": 0,

"uploaded_by": "Legistify",

"uploaded_by_name": "Legistify",

"created": "17 Jan 2024",

"doc_case": 289801478,

"is_public": 1,

"title": "order - 17 Jan 2024",

}

],

"hearings": [

{

"purpose": null,

"stage": null,

"proceeding": "1-NEXT DATE",

"judge": "HONOURABLE MR. JUSTICE HASMUKH D. SUTHAR",

"status": null,

"court_data_id": 289801478,

"doh": "07 Feb 2024",

"ndoh": "19 Feb 2024",

"cause_list_type": null,

"court": "Gujarat High Court"

}

],

"act_data": {

"section": "14 Feb 0173",

"name": "U/S 173 of Motor Vehicle Act"

},

"case_ancillary_details": [

{

"field_name": "high_court_bench_type",

"field_value": "SINGLE"

},

{

"field_name": "district",

"field_value": "VALSAD"

},

{

"field_name": "court_code",

"field_value": "13 Feb 5052"

},

{

"field_name": "case_description",

"field_value": "SPECIAL CRIMINAL APPLICATION"

},

{

"field_name": "side_code",

"field_value": "R"

},

],

"respondent_petitioner": [

{

"advocate": null,

"petitioner": true,

"name": "SAHILESHBHAI MAGANBHAI HALATI",

"address": null,

"respondent": false

},

{

"advocate": null,

"petitioner": false,

"name": "STATE OF GUJARAT",

"address": null,

"respondent": true

},

{

"advocate": null,

"petitioner": false,

"name": "POLICE INSPECTOR",

"address": null,

"respondent": true

}

],

"orders_count": 1,

"hearing_count": 1,

"case_type_id": null,

“client_unique_key”:”PHHC010249471994”

}

}

Note: Don't forget to set your 'access-token’ token in the header to your API requests

Request Body: case_id: Unique id of a case also data-type should be integer.

3. Add case to tracking API:

Curl Request:

--method : POST

--header 'access-token: <client's token>'

--header 'Content-Type: application/json'

--payload = json.dumps({

"case_id": 85658095,

"client_unique_id": "lmt-85658095"

})

Success Response Example:

{

"type": "Success",

"status": 200,

"message": "Your case has been added successfully."

}

Error Response Example:

{

"type": "Failed",

"status": 403,

"error": "Validation Error, case_id or unique_key must required."

}

Note: Don't forget to set your 'access-token’ token in the header to your API requests

Request Body:

● case_id: Unique id of a case

● client_unique_id: Client's unique id for the case (e.g., claim no./loan no.)

4. Update Case Response:

We will send the updated case details to you through your webhook per-case wise. Following receipt, you can save these updated details to the respective case in your system. This process ensures that your case records remain current and reflective of the latest information.

{

"id": 289801436,

"court_link_id": 776,

"respondent": "STATE OF GUJARAT",

"complainant": "RAKESH VINODBHAI JHAVERI",

"date_of_filing": "12 Jan 2024",

"date_of_registration": "12 Jan 2024",

"filing_no": "SCR.A/2015/2024",

"registration_no": null,

"type_name": "SCR.A",

"court_no": null,

"court_name": "Gujarat High Court",

"year": "13 Feb 2024",

"scrape_type": 29,

"scraped_status": 1,

"first_hearing_date": null,

"last_hearing_date": "24 Jan 2024",

"court_number_and_judge": "HONOURABLE MR. JUSTICE HASMUKH D. SUTHAR",

"nature_of_disposal": null,

"is_alloted": false,

"disposal_date": null,

"respondent_lawyers": "m/s.a.immanuel,", complainant_lawyers

"complainant_lawyers": "R/SCR.A/724/2024",

"ep_case_no": "R/SCR.A/724/2024",

"hearing_date": "22 Feb 2024",

"date_of_disposal": null,

"scrape_court": "Gujarat High Court",

"alloted": null,

"hidden_complainant": "N",

"hidden_respondent": "N",

"cino": "GJHC240036802024",

"case_no": "R/SCR.A/724/2024",

"case_no_new": "GJHC240036802024",

"case_no2": "GJHC240036802024",

"disposed": 0,

"stage": "529-FOR ADMISSION",

"case_status": "PENDING",

"court_link": {

"court_link": {

"name": "Gujarat High Court",

"city": {

"name": "Ahmedabad",

"state": {

"name": "Gujarat",

"region": "W"

}

}

}

},

"court_data": {

"name": "Gujarat High Court",

"district": "Ahmedabad",

"state": "Gujarat"

},

"case_type_id": null,

“client_unique_key”:”PHHC010249471994”

}

5. Add case to archive API:

The "Add Case to Archive" API serves as an essential component in managing client cases efficiently. By utilizing this API, cases can be seamlessly archived, signifying the conclusion of their active tracking. Once a case is added to the archive section, the tracking process is halted, and updates or notifications pertaining to that particular case will no longer be provided. This ensures a streamlined and organized approach to case management, allowing for the efficient handling of concluded cases without unnecessary ongoing notifications.

Curl Request:

--method : POST

--header 'access-token: <client's token>

--header 'Content-Type: application/json'

--payload = payload = json.dumps({

"cases_ids": [2,3,4],

"action": "add_to_archive"

})

Success Response Example:

{

"type": "Success",

"status": 200,

"succeed cases": [282125773],

"failed cases": [],

"not found cases": []

}

Error Response Example:

{

"type": "Failed",

"status": 500,

"error": "Something went wrong."

}

Note: Don't forget to set your 'access-token’ token in the header to your API requests

Can archive only tracked case

Request Body:

● cases_ids: You can add multiple unique IDs of cases, and the data type for the `cases_ids` key should be a list.

● action: You can send the action as either "add_to_archive" or "remove_from_archive" based on your conditions, and the data type for the `action` key should be a string.

5. Litigation API Authentication:

Static Token Authentication

  • Purpose: Used for consistent and long-term access without the need for frequent reauthentication.

  • Token: A fixed token that remains valid until it is manually changed or expired.

  • Example Token: eyJjbGllbnRfaWQiOiAiNiIsICJjcmVhdGVkQXQiOiAiMjAyNC0wOS0xMCAxMDoxNjo1NyIsICJ0b2tlbl90eXBlIjogIkR5bmFtaWMiLCAiZXhwaXJlc19hdCI6ICIyMDI0LTA5LTExIDEwOjE2OjU3In0=

  • Use Case: Ideal for applications or services where the authentication token does not need to be refreshed frequently.

  • Implementation: Include the static token in the Authorization header of your API requests.

Dynamic Token Authentication

  • Purpose: Provides access based on dynamically generated tokens that expire after a certain period, enhancing security.

  • Token Generation: Obtain a new token by making a request to a specific endpoint with valid credentials.

  • Use Case: Suitable for environments where security is a concern and tokens should be frequently refreshed.

  • Implementation: Use the generated access_token in the Authorization header of your API requests. Tokens must be refreshed before they expire.

    Curl Request:

    --header 'Content-Type: application/json' \

    --data '{

    "username":"test-org",

    "password":"[Ulx38i=gy0>$Hr> "

    }'

    Success Response Example:

    {

    "type": "Success",

    "Access_token": "eyJjbGllbnRfaWQiOiA2LCAiY3JlYXRlZEF0IjogIjIwMjQtMDktMTAgMTA6MjE6MjUiLC AidG9rZW5fdHlwZSI6ICJEeW5hbWljIiwgImV4cGlyZXNfYXQiOiAiMjAyNC0wOS0xMSAxMDoyMToyNSJ9",

    "expires_at": "2024-09-11 10:21:25"

    }

    Failed Response Example:

    {

    "type": "Failed",

    "error": "Invalid username or password"

    Note: For both authentication types, ensure you have the correct credentials and consult with the Legistify team for any specific queries or issues related to authentication.

Did this answer your question?