1. List document's labels (api1/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-usa-uat.iinsightonline.com/api1/documents/labels |
GET |
| PRODUCTION |
https://api-usa.iinsightonline.com/api1/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
[
{
"id": "18",
"name": "Solicitor Documents",
"order": "1",
"amount": 2
},
{
"id": "10",
"name": "Receipts Single",
"order": "2",
"amount": 0
},
]
2. List documents (api1/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-usa-uat.iinsightonline.com/api1/documents |
GET |
| PRODUCTION |
https://api-usa.iinsightonline.com/api1/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
[
{
"id": "1",
"role": "xxx",
"w": "W",
"document_status": "xxx",
"document_status_color": "xxx",
"billing_id": "1",
"created": "dd-mm-yyyy",
"date_sended_or_downloaded": "dd-mm-yyyy",
"author": "xxxx",
"title": "xxxx",
"modify_by": "xxx",
"date_modified": "dd-mm-yyyy",
"file_type": "xxx",
"details": "xxxx"
},
{
"id": "2",
"role": "xxx",
"w": "W",
"document_status": "xxx",
"document_status_color": "xxx",
"billing_id": "1",
"created": "dd-mm-yyyy",
"date_sended_or_downloaded": "dd-mm-yyyy",
"author": "xxxx",
"title": "xxxx",
"modify_by": "xxx",
"date_modified": "dd-mm-yyyy",
"file_type": "xxx",
"details": "xxxx"
}
]
3. Get document details (api1/documents/details)
This method will answer with a collection of document's details.
URL
| Server |
URL |
HTTP type |
| UAT |
https://api-usa-uat.iinsightonline.com/api1/documents/details |
GET |
| PRODUCTION |
https://api-usa.iinsightonline.com/api1/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 |
| 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
{
"date": "21-08-2017",
"author": "Fernando Burgoa",
"author_id": "120",
"details": "",
"title": "PPT upload single-Clone1",
"title_id": "",
"status_id": "4097",
"status": "Draft (Legacy)",
"billing_id": "0",
"role_id": "0",
"role": null,
"labels": [
{
"label_id": "8",
"label_desc": "Others"
},
{
"label_id": "10",
"label_desc": "Receipts Single"
},
{
"label_id": "12",
"label_desc": "Doctors Certificates"
},
{
"label_id": "18",
"label_desc": "Solicitor Documents"
}
]
}
4. Toggle Document status (api1/documents/status)
This method will allow to toggle a document status between approved and draft.
URL
| Server |
URL |
HTTP type |
| UAT |
https://api-usa-uat.iinsightonline.com/api1/documents/status |
PUT |
| PRODUCTION |
https://api-usa.iinsightonline.com/api1/documents/status |
PUT |
Authorization
| Parameter |
Value |
Mandatory |
| Type |
Bearer Token |
Yes |
| Token |
The token is generated using the /auth/login method |
Yes |
Query Params (As it's PUT method this need to go on the x-www-form-urlencoded)
| Parameter |
Value |
Mandatory |
| id |
Document ID. (i.e.: 1) |
Yes |
Response
{
"respond": "Document edited",
"id": "7039"
}
5. Download document (api1/documents/download)
This method will allow to download case documents. Aproved documents ('.doc', '.docx', '.xls', '.xlsx') will be download as PDF.
URL
| Server |
URL |
HTTP type |
| UAT |
https://api-usa-uat.iinsightonline.com/api1/documents/download |
GET |
| PRODUCTION |
https://api-usa.iinsightonline.com/api1/documents/download |
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 |
| id |
Document ID. (i.e.: 1) |
Yes |
Response
document_file.extension
6. Upload document (api1/documents/upload)
This method will allow to upload case documents.
File types allowed: 'doc', 'xls', 'docx', 'xlsx', 'pdf', 'jpg', 'jpeg','gif', 'png', 'heic', 'tif', 'tiff', 'ifm', 'msg', 'ppt', 'pptx' ,'pptm' ,'pub' , 'xps', 'itp', 'dss', 'eml', 'mp3', 'mp4', 'switch', 'txt', 'docm', 'zip', 'mov', 'wav', 'htm', 'html', 'm4a'.
URL
| Server |
URL |
HTTP type |
| UAT |
https://api-usa-uat.iinsightonline.com/api1/documents/upload |
POST |
| PRODUCTION |
https://api-usa.iinsightonline.com/api1/documents/upload |
POST |
Authorization
| Parameter |
Value |
Mandatory |
| Type |
Bearer Token |
Yes |
| Token |
The token is generated using the /auth/login method |
Yes |
Query Params
| Parameter |
Value |
Mandatory |
| file_name |
File name without file extension (i.e.: 'Driving license') |
No |
| file |
A valid document file |
Yes |
| case_id |
Case ID (i.e.: 1) |
Yes |
| author_id |
Author ID (user id) |
Yes |
| date |
Date created (i.e.: dd-mm-yyyy) |
Yes |
| details |
Document details |
No |
| status_id |
Document status ID (i.e.: 1) |
Yes |
| label_ids |
Document label IDs (i.e.: 1,2,3) |
Yes |
| billing_id |
Billing ID (i.e.: 1) |
No |
Response
{
"response": "File successfuly uploaded",
"status": true,
"id": 7228
}
7. List Custom forms (api1/documents/custom_forms)
This method will answer with a collection of iinsight's custom forms that belong to a case. The collection will be in JSON format.
The results can be paginated, giving a limit per page not greater than 100 and it be filter by contact status, search criteria or sorted by asc or desc. An empty collection and a status code 200 response, means that there is no records in the specified page and filters.
URL
| Server |
URL |
HTTP type |
| UAT |
https://api-usa-uat.iinsightonline.com/api1/documents/custom_forms |
GET |
| PRODUCTION |
https://api-usa.iinsightonline.com/api1/documents/custom_forms |
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 |
| 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
[
{
"id": "1",
"description": "this is a description",
"form_name": "this a name",
},
{
"id": "2",
"description": "this is a description",
"form_name": "this a name",
}
]
8. New custom form (api1/documents/custom_forms)
This method will allow to create a custom form document.
URL
| Server |
URL |
HTTP type |
| UAT |
https://api-usa-uat.iinsightonline.com/api1/documents/custom_forms |
POST |
| PRODUCTION |
https://api-usa.iinsightonline.com/api1/documents/custom_forms |
POST |
Authorization
| Parameter |
Value |
Mandatory |
| Type |
Bearer Token |
Yes |
| Token |
The token is generated using the /auth/login method |
Yes |
Query Params
| Parameter |
Value |
Mandatory |
| form_id |
Custom form ID (i.e.: 1) |
Yes |
| case_id |
Case ID (i.e.: 1) |
Yes |
| title |
Document title |
Yes |
| author_id |
Author ID (user id) |
Yes |
| date |
Date created (i.e.: dd-mm-yyyy) |
Yes |
| details |
Document details |
No |
| status_id |
Document status ID (i.e.: 1) |
Yes |
| label_ids |
Document label IDs (i.e.: 1,2,3) |
Yes |
| billing_id |
Billing ID (i.e.: 1) |
No |
Response
{
"status": true,
"id": 1,
"response": "Custom form successfuly created"
}
9. Get document URL (api1/documents/geturl)
This method will provide the URL for a document based on the provided document ID. The response will be in JSON format.
URL
| Server |
URL |
HTTP type |
| UAT |
https://api-usa-uat.iinsightonline.com/api1/documents/geturl |
GET |
| PRODUCTION |
https://api-usa.iinsightonline.com/api1/documents/geturl |
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 |
| id |
Document ID (i.e., 123) |
Yes |
Response
{
"error": "",
"url": "https://example.com/document/123.pdf"
}
Validation Errors
{
"error": "error",
"url": "No such file."
}