API version 2 Documents

1. List documents (api2/documents)

This method will answer with a collection of documents. The collection will be in JSON format.

URL
Server URL HTTP type
UAT https://api-aus-uat.iinsightonline.com/api2/documents GET
PRODUCTION https://api-aus.iinsightonline.com/api2/documents GET
Authorization
Parameter Value Mandatory
Type Bearer Token Yes
Token The token is generated using the /auth/login method Yes
Query Params
Parameter Value Mandatory
case_id Case ID. (i.e.: 1) Yes
label_id Document's label ID. (i.e.: 1) No
status_id Document's status ID. (i.e.: 1) No
fields Contacs fields seperated by comma and no blank spaces. (i.e.: field_name1,field_name2,...) Yes
sort_col Sort by column field name. (i.e.: field_name) No
sort_type Sort column type. Options: asc, desc No
search_criteria Search field name. (i.e.: {"field_name1":"value1","field_name2":"value1,value2"}) No
page The page number of the paginated results. (i.e.: 1) No
limit The limit amount of items. (i.e.: 1) No
Response

  {
    "status": true,
    "message": "Documentation retrieved successfully",
    "total_records": 2,
    "data": [
        {
            "id": "7568",
            "custom_form_type": "0",
            "document_status": "Draft (Legacy)",
            "document_status_color": "d2b48c",
            "file_type": "cform",
            "title": "zed_custom_form",
            "author": "Marc TOledo"
        },
        {
            "id": "7530",
            "custom_form_type": null,
            "document_status": "Approved",
            "document_status_color": "59ba57",
            "file_type": "docx",
            "title": "campos cases",
            "author": "Dan Howard"
        }
    ],
    "permissions": {
        "priv_view_own_doc": "No",
        "priv_view_own_role_doc": "No",
        "priv_view_approved_doc": "No",
        "priv_view_all_doc": "Yes",
        "priv_unlabeled_documents": "Yes"
    }
}

2. List document's labels (api2/documents/labels)

This method will answer with a collection of document's labels. The collection will be in JSON format.

URL
Server URL HTTP type
UAT https://api-aus-uat.iinsightonline.com/api2/documents/labels GET
PRODUCTION https://api-aus.iinsightonline.com/api2/documents/labels GET
Authorization
Parameter Value Mandatory
Type Bearer Token Yes
Token The token is generated using the /auth/login method Yes
Query Params
Parameter Value Mandatory
case_id Case ID. (i.e.: 1) Yes
Response

  {
    "status": true,
    "message": "Document Labels retrieved successfully",
    "total_records": 3,
    "data": [
        {
            "id": "-1",
            "name": "All Documents",
            "order": "0",
            "amount": 475
        },
        {
            "id": "18",
            "name": "Solicitor Documents",
            "order": "1",
            "amount": 21
        },
        {
            "id": "35",
            "name": "Unlabelled",
            "order": "-99",
            "amount": 371
        }
    ]
}

3. Get document details (api2/documents/details)

This method will answer with a collection of document's details.

URL
Server URL HTTP type
UAT https://api-aus-uat.iinsightonline.com/api2/documents/details GET
PRODUCTION https://api-aus.iinsightonline.com/api2/documents/details GET
Authorization
Parameter Value Mandatory
Type Bearer Token Yes
Token The token is generated using the /auth/login method Yes
Query Params
Parameter Value Mandatory
documentation_id Document ID. (i.e.: 1,2,3...) Yes
label_id Label ID (e.g.: 1,2,3...). If left empty, it will be considered as Unlabelled. If "-1" is provided, all labels will be included. No
Response

  {
    "status": true,
    "message": "Document Details retrieved successfully",
    "data": {
        "date": "20-01-2015",
        "author": "iinsight Software Support",
        "author_id": "1",
        "details": "",
        "title": "IINSIGHT_Be Software Key Contact Details",
        "title_id": null,
        "status_id": "4097",
        "status": "Draft (Legacy)",
        "billing_id": "0",
        "role_id": "0",
        "role": null,
        "labels": {
            "selected": [
                {
                    "id": "12",
                    "label": "Doctors Certificates"
                }
            ],
            "assigned": [
                {
                    "id": "8",
                    "label": "Others"
                },
                {
                    "id": "10",
                    "label": "Receipts Single"
                },
                {
                    "id": "12",
                    "label": "Doctors Certificates"
                }
            ]
        }
    }
}

4. Change document status (api2/documents/status)

This method allows toggling a document's status between approved and draft.

URL
Server URL HTTP Type
UAT https://api-aus-uat.iinsightonline.com/api2/documents/status PUT
PRODUCTION https://api-aus.iinsightonline.com/api2/documents/status PUT
Authorization
Parameter Value Mandatory
Type Bearer Token Yes
Token The token is generated using the /auth/login method Yes
Query Params
Parameter Description Mandatory
document_id The ID of the document (e.g., 1) Yes
status_id The ID of the new status (e.g., 2 for approved, 3 for draft) Yes
Response

{
  "status": true,
  "message": "Document Status updated successfully",
  "data": true
}

5. Update Documentation Details (api2/documents/details)

This method allows updating the details of a document, such as its author, status, billing information, and related case.

URL
Server URL HTTP Type
UAT https://api-aus-uat.iinsightonline.com/api2/documents/details PUT
PRODUCTION https://api-aus.iinsightonline.com/api2/documents/details PUT
Authorization
Parameter Value Mandatory
Type Bearer Token Yes
Token The token is generated using the /auth/login method Yes
Query Params
Parameter Description Mandatory
document_id The ID of the document (e.g., 1) Yes
label_ids List of label IDs (optional, can be null) No
date The date associated with the document (optional, can be null) Yes
author_id The ID of the author (must be a valid user ID) Yes
status_id The status ID of the document (optional, can be null) No
billing_id The ID of the related billing record (optional, can be null) No
role_id The role ID associated with the document (optional, can be null) No
case_id The case number associated with the document Yes
type Type of document: "all" or "enabled" (optional, can be null) No
Response

{
    "status": true,
    "message": "Documentation details updated successfully.",
    "data": {
        "updated_document": true,
        "created_note": {
            "response": "Document note created successfuly",
            "id": 119282
        },
        "toggle_status": false
    }
}