Rd Docflow API

29 August 2018

Centralized API service for storing, searching and retrieving documents and files. 

Login

Authenticate with the system
URL:
/auth/login
Method:
POST
Data Params
name mandatory type description
username x String Username
password x String Password
Success Response:

  • Code: 200
  • Content

{
“status” : “OK”,
“data” : {
“message”: “Use this token for API calls”,
“token” : “AWJxFPLlRRwS3yKMyzUWAWJxFPLlRRwS3yKMyzUW”,
“user” : {
“username” : “authorized-user”,
“active” : “true”
}
}
}
Error Response:

  • Code: 401 or 500
  • Content {status:’ERROR’, data: ‘Error message’}

Notes
Token returned from login request is required to use in each of the API requests as a
“x-access-token” header, “token” query parameter or “token” post data parameter. Without proper
token API will respond with errors.

Logout

Log out from the system
URL:
/auth/logout
Method:
POST
Success Response:
? Code: 200
? Content { “status” : “OK” }
Error Response:
? Code: 400
? Content {status:’ERROR’, data: ‘Error message’}

Upload Document

Uploads new Document to the system.
URL:
/document
Method:
POST
URL Params
name mandatory type description
name x String Document name
path x String Path in the system
parseAttachment boolean Index doc contents
doOcr boolean Perform OCR on doc

name mandatory type description

generatePreview boolean generate thumbnail
waitForIndexing boolean Return after indexing
date Date Override current date
Multipart Params
name mandatory type description
attachment x bytes Document name
meta json Client specific data
Success Response:
? Code: 200
? Content {status:’OK’}
Error Response:
? Code: 400
? Content {status:’ERROR’}
Notes
Request is multipart

Search documents
Search documents by different fields and content
URL:
/document
Method:
GET
URL Params:
name mandatory type description
q String Query string
from Integer Start from record
size Integer Maximum number of records returned

name mandatory type description
path String Path to search
type String type of record: directory/file
meta.x String Search meta field. x is any meta field
meta.y String Search meta field. x is any meta field
Data Params:
None
Success Response:
? Code: 200
? Content {status:’OK’}
Error Response:
? Code: 400
? Content {status:’ERROR’}

Get number of records
Returns total number of records for some query. Used to get total number for query string when
using pagination.
URL:
/document/get-number-of-records
Method:
GET
URL Params:
name mandatory type description
q String Query string
path String Path to search
Data Params:
None

Success Response:
? Code: 200
? Content {status:’OK’}
Error Response:
? Code: 400
? Content {status:’ERROR’}

Create directory
Creates directory recursively the system
URL:
/document/create-directory
Method:
POST
URL Params:
name mandatory type description
path String Path to search
Data Params:
None
Success Response:
? Code: 200
? Content {status:’OK’}
Error Response:
? Code: 400
? Content {status:’ERROR’}

Get document
Retrieves document record – all data except bytes
URL:
/document/:id
Method:
GET
URL Params:
name mandatory type description
id x String ID of document
Data Params:
None
Success Response:
? Code: 200
? Content {status:’OK’}
Error Response:
? Code: 400
? Content {status:’ERROR’}

Download document
Retrieves document data – attachment
URL:
/document/:id/attachment
Method:
GET

URL Params:
name mandatory type description
id x String ID of document
Data Params:
None
Success Response:
? Code: 200
? Content {status:’OK’}
Error Response:
? Code: 400
? Content {status:’ERROR’}

Download document thumbnail
Retrieves document thumbnail
URL:
/document/:id/thumbnail
Method:
GET
URL Params:
name mandatory type description
id x String ID of document
Data Params:
None
Success Response:
? Code: 200

? Content {status:’OK’}
Error Response:
? Code: 400
? Content {status:’ERROR’}

Update meta data
Updates document meta data
URL:
/document/:id/update-meta
Method:
POST
URL Params:
name mandatory type description
id x String ID of document
Data Params:
Body should contain JSON structure of meta data
Success Response:
? Code: 200
? Content {status:’OK’}
Error Response:
? Code: 400
? Content {status:’ERROR’}

Delete
Delete document – record and data

URL:
/document/:id
Method:
DELETE
URL Params:
name mandatory type description
id x String ID of document
Data Params:
None
Success Response:
? Code: 200
? Content {status:’OK’}
Error Response:
? Code: 400
? Content {status:’ERROR’}

Scroll to Top