Update Document

Endpoint Name : update_document

Request type : POST

Authorization : Bearer token as header

Endpoint Details : The update_documentendpoint will be used to update the document.

Method

URL

POST

URL/access/klearstack/update_document

Request Body

Params

Values

Required

Description

company_name

string

Yes

Name of the company for which the user is logging in.

collection_name

string

Yes

Name of collection of document.

id

string

Yes

ID of document.

data

string(JSON)

Yes

A valid JSON string containing details of updates to be done to fields of Document.

If coordinates are not available then array will [0,0,0,0]

Example :

{ "doc_date_value": {

"_value": "02-Oct-2022",

"_coordinates": [1306,87,1444,107],

},

"doc_number_value": {

"_value": "287269549621X10102022",

"_coordinates": [1306,87,1444,107],

},

}

Shell (cURL)

  • Request Body

curl --location "URL/access/klearstack/update_document" \
  --header "Authorization: Bearer your_token_here" \
  --form "company_name=Replace_Company_Name_Here" \
  --form "collection_name=Replace_Collection_Name_Here" \
  --form "id=Replace_Document_ID_Here" \
  --form 'data={
    "doc_date_value": {
        "_value": "02-Oct-2022",
        "_coordinates": [1306, 87, 1444, 107]
    },
    "doc_number_value": {
        "_value": "287269549621X10102022",
        "_coordinates": [1306, 87, 1444, 107]
    }
}'

Python

  • Request Body

Java (OkHttp)

  • Request Body

Node.js

  • Request Body

JavaScript (XHR)

  • Request Body

API Response

Status code

Example Response

200

Json Response

Last updated