Upload new version of document

post

/documentManagement/v1/{documentManagementSystemId}/documents/{documentId}

Upload a new file version

Request

Path Parameters
Supported Media Types
Request Body - multipart/form-data ()
Root Schema : schema
Type: object
Show Source
Back to Top

Response

Supported Media Types

200 Response

New File version uploaded
Body ()
Root Schema : DocumentResponseBody
Type: object
Show Source

400 Response

Request validation failed
Body ()
Root Schema : Error
Type: object
Used when an API throws an Error, typically with a HTTP error response-code (3xx, 4xx, 5xx)
Show Source

401 Response

Authorization failure. The authorization header is invalid or missing.
Body ()
Root Schema : Error
Type: object
Used when an API throws an Error, typically with a HTTP error response-code (3xx, 4xx, 5xx)
Show Source

403 Response

Operation is not permitted based on the supplied authorization.
Body ()
Root Schema : Error
Type: object
Used when an API throws an Error, typically with a HTTP error response-code (3xx, 4xx, 5xx)
Show Source

500 Response

Internal Server Error
Body ()
Root Schema : Error
Type: object
Used when an API throws an Error, typically with a HTTP error response-code (3xx, 4xx, 5xx)
Show Source
Back to Top

Examples

The following example shows how to upload new version of document by submitting a post request on the REST resource using cURL.

cURL Command

curl --<username:password> --request POST '{FABRIC_HOST}/documentManagement/v1/{documentManagementSystemId}/documents/{documentId}' --header 'Authorization: Bearer <accessToken> --header 'Content-Type: application/json' -D @uploadnewdocumentversion.JSON

Example of Request Body

The following shows an example of the request body in JSON format.

------------------------------362052356708186529598553
Content-Disposition: form-data; name="folderData"
  
  {
    "folderId": "DB1C5AF480FFE61C588027A8T000000000010000331"
  }
------------------------------362052356708186529598553
Content-Disposition: form-data; name="file"; filename="Contracts.pdf"
Content-Type: application/pdf
  
<Actual File Content in binary format goes here>
------------------------------362052356708186529598553--'

Example of Response Body

The following shows an example of the response body in JSON format.

{
  "id": "DB1C5AF480FFE61C588027A8T0000000000100000001",
  "folderId": "DB1C5AF480FFE61C588027A8T000000000010000331",
  "name": "Contracts.pdf",
  "createdBy": "User_Name",
  "createdWhen": "2014-02-21T21:32:37Z",
  "updatedBy": "User_Name",
  "updatedWhen": "2014-02-21T21:32:37Z",
"href": "/documentManagement/v1/ocm-1/documents/DB1C5AF480FFE61C588027A8T000000000010000331/data?folderId=DB1C5AF480FFE61C588027A8T000000000010000331",
  "version": "1"
}
Back to Top