Published using Google Docs
DocMan by DocsCloud - API Integration
Updated automatically every 5 minutes

DocMan by DocsCloud - API Integration

Version

Date

Author

Description

1.0

27 February 2023

DocsCloud Tech Team

Initial documentation

DocMan (by DocsCloud) provides a simple way to create and manage objects in AWS buckets. Consider this an attempt to translate your AWS S3 bucket into a simple Enterprise Content Management System.

Here are the APIs you can use to interact with the DocMan module.

Saving a File

This API helps to save documents over AWS storage.

Request Body

Method

URL            

POST

https://app.docscloud.io/api/v2/docman-save

Type

Params

Values

POST

POST

POST

POST

POST

POST

POST

POST

POST

auth_id

auth_token

folder_id

input_file_type

file_url

base_64_file

base_64_file_name

file_replace

public

string

string

string

string

string

string

string

string

string

mandatory

mandatory

mandatory

mandatory

optional

optional

optional

mandatory

mandatory

auth_id: Authentication ID. This remains constant for your account. You can find this in your profile section.

auth_token: Authentication token. Consider this as a password for your account. You can find this in your profile section.

folder_id: This is the folder ID where you wish to save the document.

input_file_type: You can either send the file URL as input or the file content in Base64 format. This field helps DocMan to identify the type of input. Valid values - 1 (for URL), 2 (for Base64 data)

file_url: Assuming you have Input_file_type=1, this field becomes mandatory. Send the file URL here in this field. Make sure that the file should be accessible.

base_64_file: Assuming you have Input_file_type=2, this field becomes mandatory. Send the file content here in this field in a Base 64 format.

base_64_file_name: Assuming you have Input_file_type=2, then this field becomes mandatory. Send the file name here.

file_replace: Use this field to define if the new file should replace the existing file (if present, with the same name). replace the existing file or not. Valid values - 1 (yes; replace), 2 (no; create a new file without replacement).

public: Use this field to define if the file path should be accessible to not-accessible to public access. Valid values - 1 (public), 2 (private).

Response

Status

Response

200

{

    "success": true,

    "data": {

        "doc_id": x,

        "doc_url": "xx",

        "public": "xx"

    },

    "message": "Task Completed Successfully."

}

On successful processing, you will receive the document ID and the AWS URL path in response. Kindly save the document ID in your system.

Accessing a File

This API helps to access documents over AWS storage.

Request Body

Method

URL            

POST

https://app.docscloud.io/api/v2/docman-access

Type

Params

Values

POST

POST

POST

POST

POST

auth_id

auth_token

input_type

doc_id

doc_url

string

string

string

string

string

mandatory

mandatory

mandatory

optional

optional

auth_id: Authentication ID. This remains constant for your account. You can find this in your profile section.

auth_token: Authentication token. Consider this as a password for your account. You can find this in your profile section.

input_type: You can retrieve the document by sending the Document ID or the Document AWS URL. This field tells DocsMan the input that is passed in the request. Valid values - 1 (if you are passing the document ID in request), 2 (if you are passing the document URL in request)

doc_id: Assuming you have Input_type=1, then this field becomes mandatory. Pass the document ID in this field.

doc_url: Assuming you have Input_type=2, then this field becomes mandatory. Pass the document URL in this field.

Response

Status

Response

200

{

    "success": true,

    "data": {

        "doc_url": "xx",

        "doc_base_64": "xx"

    },

    "message": "Task Completed Successfully."

}

On successful processing, you will receive the document URL and the document in the Base64 format.

Deleting a File

This API helps to delete documents stored in AWS storage.

Request Body

Method

URL            

POST

https://app.docscloud.io/api/v2/docman-delete

Type

Params

Values

POST

POST

POST

POST

POST

auth_id

auth_token

input_type

doc_id

doc_url

string

string

string

string

string

mandatory

mandatory

mandatory

optional

optional

auth_id: Authentication ID. This remains constant for your account. You can find this in your profile section.

auth_token: Authentication token. Consider this as a password for your account. You can find this in your profile section.

input_type: You can delete the document by sending the Document ID or the Document AWS URL. This field tells DocsMan the input that is passed in the request. Valid values - 1 (if you are passing the document ID in request), 2 (if you are passing the document URL in request)

doc_id: Assuming you have Input_type=1, then this field becomes mandatory. Pass the document ID in this field.

doc_url: Assuming you have Input_type=2, then this field becomes mandatory. Pass the document URL in this field.

Response

Status

Response

200

{

    "success": true,

    "data": [],

    "message": "Task Completed Successfully."

}

On successful processing, the file will get deleted and you will receive a successful response.

Error Status Codes

DocsCloud uses HTTP response status codes to indicate the success or failure of your API requests. DocsCloud returns an error if your request fails using the appropriate status code. In general, you can expect three status code ranges:

All status codes are standard HTTP status codes. The below ones are used in this API.

2XX - success status codes confirm that your request worked as expected

4XX - error status codes indicate an error because of the information provided (e.g., a required parameter was omitted)

5XX - error status codes are rare and indicate an error with DocsCloud servers.

Status Code

Description

200

OK - Everything worked as expected.

400

Bad Request - The request was unacceptable, often due to missing a required parameter.

401

Unauthorised - No valid API key provided.

402

Request Failed - The parameters were valid, but the request failed.

403

Forbidden - The API key doesn't have permission to perform the request.

404

Not Found - The requested resource doesn't exist.

409

Conflict - The request conflicts with another request (perhaps due to using the same idempotent key).

429

Too Many Requests - Too many requests hit the API too quickly. We recommend an exponential backoff of your requests.

500/2/3/4

Server Errors - Something went wrong on DocsCloud's end.