Back to top

Documents APIs

Overview

The Documents API provides endpoints to manage documents in the system. You can use these endpoints to view, upload, rename, delete, and set the visibility of documents. These are RESTful APIs that use standard HTTP methods and return JSON responses. These APIs require authentication using a bearer token.

Bearer Token

A bearer token is a type of access token that is used for authorization in APIs. It is a cryptic string that is generated by the server in response to a login request. The client must send this token in the Authorization header when making requests to protected resources.

The “Bearer” keyword is a signal to the server that the token is a type of bearer token. Here’s an example of how to use it:

Authorization: Bearer <Your-Bearer-Token>

Replace with your actual bearer token.

For example:

Authorization: Bearer 5262d64b892e8d4341000001

Error Messages

  • 400 Bad Request: This error is returned when the server could not understand the request due to invalid syntax. Check your request body and parameters.

  • 401 Unauthorized: This error is returned when the request lacks valid authentication credentials for the target resource. Make sure your API key is correct.

  • 403 Forbidden: This error is returned when the server understood the request, but it refuses to authorize it. This status is often returned if you’re missing permissions to access the resource.

  • 404 Not Found: This error is returned when the server can’t find the requested resource. Check your endpoint and parameters.

  • 500 Internal Server Error: This error is returned when the server encounters an unexpected condition that prevented it from fulfilling the request.

Documents APIs

get_tree_node_document_apis

get_tree_node_document_apis
GET/api/documents/get_tree_node_document_apis/0

Overview:

The get_tree_node_document_apis endpoint, accessible at /api/documents/get_tree_node_document_apis/0, is a GET request that is used to get the tree node document APIs.

Request Body and Response Description:

Name Data Type Description
key string The key of the document.
children array An array of child documents.

Example URI

GET [Portal APIs](https://test-api.wastelinq.com)./api/documents/get_tree_node_document_apis/0
Request
HideShow
Headers
Content-Type: application/json
Authorization: {TOKEN}
Response  200
HideShow
Headers
Content-Type: application/json
Body
[
  {
    "key": "genroot_31_0",
    "children": [
      {
        "key": "3d_31_0",
        "children": []
      },
      {
        "key": "archivegroup_31_0",
        "children": [
          {
            "key": "arcinvoices_31_0",
            "children": []
          },
          {
            "key": "arcgens_31_0",
            "children": []
          },
          {
            "key": "arcyear_31_0",
            "children": [
              {
                "key": "arcyear2017_31_0",
                "children": [
                  {
                    "key": "arcinv2017_31_0",
                    "children": []
                  },
                  {
                    "key": "arcgen2017_31_0",
                    "children": []
                  }
                ]
              }
            ]
          }
        ]
      }
    ]
  }
]

view_details_apis

view_details_apis
GET/api/documents/view_details_apis/{id}

Overview:

The view_details_apis endpoint, accessible at /api/documents/view_details_apis/{id}, is a GET request that is used to view the details of the document.

Request Body and Response Description:

Name Data Type Description
success boolean Indicates whether the operation was successful.
content object An object containing the details of the document.
id number The ID of the document.
issystem boolean Indicates whether the document is a system document.
showmenu boolean Indicates whether the document should be shown in the menu.
readonly boolean Indicates whether the document is read-only.
showupload boolean Indicates whether the document should show the upload button.

Example URI

GET [Portal APIs](https://test-api.wastelinq.com)./api/documents/view_details_apis/id
URI Parameters
HideShow
id
number (required) 

The ID of the document.

Request
HideShow
Headers
Content-Type: application/json
Authorization: {TOKEN}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true,
  "content": {
    "id": "3d_31_0",
    "issystem": true,
    "showmenu": false,
    "readonly": false,
    "showupload": false
  }
}

view_listfiles_apis

view_listfiles_apis
GET/api/documents/view_listfiles_apis/{id}

Overview:

The view_listfiles_apis endpoint, accessible at /api/documents/view_listfiles_apis/{id}, is a GET request that is used to view the list of files of the document.

Request Body and Response Description:

Name Data Type Description
success boolean Indicates whether the operation was successful.
content object An object containing the list of files of the document.
list_files_doc array An array of files of the document.
flagGen boolean Indicates whether the document is a general document.
list_orderDocumentationCustomField array An array of order documentation custom fields.
id number The ID of the order documentation custom field.
Name string The name of the order documentation custom field.

Example URI

GET [Portal APIs](https://test-api.wastelinq.com)./api/documents/view_listfiles_apis/id
URI Parameters
HideShow
id
number (required) 

The ID of the document.

Request
HideShow
Headers
Content-Type: application/json
Authorization: {TOKEN}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true,
  "content": {
    "list_files_doc": [],
    "flagGen": false,
    "list_orderDocumentationCustomField": [
      {
        "id": 6,
        "Name": "Approval Document"
      },
      {
        "id": 4,
        "Name": "Document for Signature"
      },
      {
        "id": 2,
        "Name": "Final Manifest"
      },
      {
        "id": 5,
        "Name": "Signed Profile"
      },
      {
        "id": 3,
        "Name": "Supporting Documentation"
      }
    ]
  }
}

view_upload_file_document_apis

view_upload_file_document_apis
POST/api/documents/view_upload_file_document_apis/{id}

Overview:

The view_upload_file_document_apis endpoint, accessible at /api/documents/view_upload_file_document_apis/{id}, is a POST request that is used to upload a file to the document.

Request Body and Response Description:

Name Data Type Description
success boolean Indicates whether the operation was successful.
nodeId string The ID of the document.

Example URI

POST [Portal APIs](https://test-api.wastelinq.com)./api/documents/view_upload_file_document_apis/id
URI Parameters
HideShow
id
number (required) 

The ID of the document.

Request
HideShow
Headers
Content-Type: application/json
Authorization: {TOKEN}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true,
  "nodeId": "invoice_31_203169"
}

view_rename_file_doc_apis

view_rename_file_doc_apis
POST/api/documents/view_rename_file_doc_apis/{id,filename}

Overview:

The view_rename_file_doc_apis endpoint, accessible at /api/documents/view_rename_file_doc_apis/{id,filename}, is a POST request that is used to rename a file of the document.

Request Body and Response Description:

Name Data Type Description
success boolean Indicates whether the operation was successful.
id number The ID of the document.

Example URI

POST [Portal APIs](https://test-api.wastelinq.com)./api/documents/view_rename_file_doc_apis/id&filename
URI Parameters
HideShow
id
number (required) 

The ID of the document.

filename
string (required) 

The name of the file.

Request
HideShow
Headers
Content-Type: application/json
Authorization: {TOKEN}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true,
  "id": 0
}

view_delete_file_doc_apis

view_delete_file_doc_apis
POST/api/documents/view_delete_file_doc_apis/{id}

Overview:

The view_delete_file_doc_apis endpoint, accessible at /api/documents/view_delete_file_doc_apis/{id}, is a POST request that is used to delete a file of the document.

Request Body and Response Description:

Name Data Type Description
success boolean Indicates whether the operation was successful.
id number The ID of the document.

Example URI

POST [Portal APIs](https://test-api.wastelinq.com)./api/documents/view_delete_file_doc_apis/id
URI Parameters
HideShow
id
number (required) 

The ID of the document.

Request
HideShow
Headers
Content-Type: application/json
Authorization: {TOKEN}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true,
  "id": "1739335"
}

view_set_ispublic_doc_apis

view_set_ispublic_doc_apis
POST/api/documents/view_set_ispublic_doc_apis/{id}

Overview:

The view_set_ispublic_doc_apis endpoint, accessible at /api/documents/view_set_ispublic_doc_apis/{id}, is a POST request that is used to set the document as public.

Request Body and Response Description:

Name Data Type Description
success boolean Indicates whether the operation was successful.
id number The ID of the document.

Example URI

POST [Portal APIs](https://test-api.wastelinq.com)./api/documents/view_set_ispublic_doc_apis/id
URI Parameters
HideShow
id
number (required) 

The ID of the document.

Request
HideShow
Headers
Content-Type: application/json
Authorization: {TOKEN}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true,
  "id": 0
}

view_set_ispublictoesc_doc_apis

view_set_ispublictoesc_doc_apis
POST/api/documents/view_set_ispublictoesc_doc_apis/{id}

Overview:

The view_set_ispublictoesc_doc_apis endpoint, accessible at /api/documents/view_set_ispublictoesc_doc_apis/{id}, is a POST request that is used to set the document as public to ESC.

Request Body and Response Description:

Name Data Type Description
success boolean Indicates whether the operation was successful.
id number The ID of the document.

Example URI

POST [Portal APIs](https://test-api.wastelinq.com)./api/documents/view_set_ispublictoesc_doc_apis/id
URI Parameters
HideShow
id
number (required) 

The ID of the document.

Request
HideShow
Headers
Content-Type: application/json
Authorization: {TOKEN}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true,
  "id": 0
}

view_new_folder_doc_apis

view_new_folder_doc_apis
POST/api/documents/view_new_folder_doc_apis/{id}

Overview:

The view_new_folder_doc_apis endpoint, accessible at /api/documents/view_new_folder_doc_apis/{id,foldername}, is a POST request that is used to create a new folder in the document.

Request Body and Response Description:

Name Data Type Description
success boolean Indicates whether the operation was successful.
id number The ID of the document.

Example URI

POST [Portal APIs](https://test-api.wastelinq.com)./api/documents/view_new_folder_doc_apis/id
URI Parameters
HideShow
id
number (required) 

The ID of the document.

Request
HideShow
Headers
Content-Type: application/json
Authorization: {TOKEN}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true,
  "id": "generator_31_772114"
}

Generated by aglio on 29 Aug 2024