Update document

Table 1. Update document API
HTTP verb URL Request parameters
PUT /cmod-rest/v1/hits/{folderName} Content Manager OnDemand folder name

JSON request payload

The update document API takes a URL encoded folder name and uses information passed as a JSON request payload to update Content Manager OnDemand folder field values for one or more documents.

The request payload consists of the following parameters formatted as JSON. See the Sample request following the table for an example.

Table 2. Request payload parameters for update document API
Parameter name Type Description
documents array Array of document objects.
docID string Content Manager OnDemand document identifier.
fields array Array of folder field objects.
fieldName string Folder field name.
fieldValue string Folder field value to modify.

Sample request

PUT /cmod-rest/v1/hits/Ledger%20Reports HTTP/1.1
usi-date: 2023-11-13T18:32:31Z
Authorization: CMODSharedKey odvttstl01-68yXERhn79KNry/oV7IY:Wwf/TpxG5u0XB0pLDYzK5wGnWZeQYeB1M/tbY7a8h28=
Content-Type: application/json
Host: localhost
Content-Length: 327
            
{
  "documents" : [ {
    "docID" : "Y2wumpdlBLHubqoHI7SOWrm2bURa4MS//K7fsMJJcMQipqF/Z/Sfhm+c7F6kAs5r9KsRg307wFXXSe5ejURkY0lM938akwCSK5tg8WYoewm2RUDkfcH7OsZUdEQPU535wBRr1SVi7ADYAJQYcySl12rJEPyaxiEA1Tf6wRYyFza+E=",
    "fields" : [ {
      "fieldName" : "Account Name",
      "fieldValue" : "Endo Biking"
    } ]
  } ]
}

The response from the update document API provides confirmation of folder field values that were modified and the success or failed status for each document. Additionally, the total number of failed updates and succeeded updates is returned.

Sample response

HTTP/1.1 200 OK
X-Powered-By: Servlet/4.0
X-Content-Type-Options: nosniff
Content-Type: application/json
Date: Mon, 13 Nov 2023 18:32:32 GMT
Correlation-Id: e053abd9-1cc1-48e8-9ced-1a670b7b1c02
Content-Language: en-US
Content-Length: 786
            
{
  "failed" : "0",
  "folderName" : "Ledger Reports",
  "hitList" : [ {
    "docID" : "Y2E0qigprXL1aWyjirMpuOzk99DPaWEdNmkjp5ptgAqHWYIcbNPdxRcSG5n4q9HFrPiHqOneDJNtf9ZZAJDO4GROAVEquPFcqA8oTIRI/lcHE3cDjxCb6CL1xzGzaIMI78+QJDUmveAxMGH61SZ3431L4tr3KwIVylNZTBqqRQWV4=",
    "docType" : "U",
    "folderFields" : {
      "Account Name" : "Endo Biking",
      "File Name" : "MONTHEND.TXT",
      "Account Number" : "123456789",
      "Report Date" : "2020-02-03"
    },
    "link" : "http://localhost:9080/cmod-rest/v1/hits/Ledger%20Reports/Y2E0qigprXL1aWyjirMpuOzk99DPaWEdNmkjp5ptgAqHWYIcbNPdxRcSG5n4q9HFrPiHqOneDJNtf9ZZAJDO4GROAVEquPFcqA8oTIRI%2FlcHE3cDjxCb6CL1xzGzaIMI78%2BQJDUmveAxMGH61SZ3431L4tr3KwIVylNZTBqqRQWV4%3D",
    "status" : "Success"
  } ],
  "succeeded" : "1"
}