Upload new version of document
post
/documentManagement/v1/{documentManagementSystemId}/documents/{documentId}
Upload a new file version
Request
Path Parameters
-
documentId(required): string
file GUID from the underlying System
-
documentManagementSystemId(required): string
Unique identifier for DMS/CMS as configured in the CXIF routing GKR criteria
Supported Media Types
- multipart/form-data
Root Schema : schema
Type:
Show Source
object-
createdBy: string
Name of the user who created the documentExample:
User_Name -
createdWhen: string
(date-time)
Date of document creationExample:
2014-02-21T21:32:37Z -
failureReason: string
Example:
File type not supported -
folderId: string
ID of the folderExample:
DB1C5AF480FFE61C588027A8T000000000010000331 -
href: string
Path to the file reachable via RMSExample:
/documentManagement/v1/ocm-1/documents/DB1C5AF480FFE61C588027A8T000000000010000331/data?folderId=123 -
id: string
ID of the documentExample:
DB1C5AF480FFE61C588027A8T0000000000100000001 -
name: string
ID of the folderExample:
Contracts.pdf -
updatedBy: string
Name of the user who updated the documentExample:
User_Name -
updatedWhen: string
(date-time)
Date of document updateExample:
2014-02-21T21:32:37Z -
uploadStatus: string
Allowed Values:
[ "SUCCESS", "FAILURE" ] -
version: string
File version numberExample:
1
Response
Supported Media Types
- application/json
200 Response
New File version uploaded
Root Schema : DocumentResponseBody
Type:
Show Source
object-
createdBy: string
Name of the user who created the documentExample:
User_Name -
createdWhen: string
(date-time)
Date of document creationExample:
2014-02-21T21:32:37Z -
folderId: string
ID of the folderExample:
DB1C5AF480FFE61C588027A8T000000000010000331 -
href: string
Path to the file reachable via RMSExample:
/documentManagement/v1/ocm-1/documents/DB1C5AF480FFE61C588027A8T000000000010000331/data?folderId=123 -
id: string
ID of the documentExample:
DB1C5AF480FFE61C588027A8T0000000000100000001 -
name: string
ID of the folderExample:
Contracts.pdf -
updatedBy: string
Name of the user who updated the documentExample:
User_Name -
updatedWhen: string
(date-time)
Date of document updateExample:
2014-02-21T21:32:37Z -
version: string
File version numberExample:
1
400 Response
Request validation failed
Root Schema : Error
Type:
objectUsed when an API throws an Error, typically with a HTTP error response-code (3xx, 4xx, 5xx)
Show Source
-
@baseType: string
When sub-classing, this defines the super-class.
-
@schemaLocation: string
(uri)
A URI to a JSON-Schema file that defines additional attributes and relationships
-
@type: string
When sub-classing, this defines the sub-class entity name.
-
code(required): string
Application relevant detail, defined in the API or a common list.
-
message: string
More details and corrective actions related to the error which can be shown to a client user.
-
reason(required): string
Explanation of the reason for the error which can be shown to a client user.
-
referenceError: string
(uri)
URI of documentation describing the error.
-
status: string
HTTP Error code extension
401 Response
Authorization failure. The authorization header is invalid or missing.
Root Schema : Error
Type:
objectUsed when an API throws an Error, typically with a HTTP error response-code (3xx, 4xx, 5xx)
Show Source
-
@baseType: string
When sub-classing, this defines the super-class.
-
@schemaLocation: string
(uri)
A URI to a JSON-Schema file that defines additional attributes and relationships
-
@type: string
When sub-classing, this defines the sub-class entity name.
-
code(required): string
Application relevant detail, defined in the API or a common list.
-
message: string
More details and corrective actions related to the error which can be shown to a client user.
-
reason(required): string
Explanation of the reason for the error which can be shown to a client user.
-
referenceError: string
(uri)
URI of documentation describing the error.
-
status: string
HTTP Error code extension
403 Response
Operation is not permitted based on the supplied authorization.
Root Schema : Error
Type:
objectUsed when an API throws an Error, typically with a HTTP error response-code (3xx, 4xx, 5xx)
Show Source
-
@baseType: string
When sub-classing, this defines the super-class.
-
@schemaLocation: string
(uri)
A URI to a JSON-Schema file that defines additional attributes and relationships
-
@type: string
When sub-classing, this defines the sub-class entity name.
-
code(required): string
Application relevant detail, defined in the API or a common list.
-
message: string
More details and corrective actions related to the error which can be shown to a client user.
-
reason(required): string
Explanation of the reason for the error which can be shown to a client user.
-
referenceError: string
(uri)
URI of documentation describing the error.
-
status: string
HTTP Error code extension
500 Response
Internal Server Error
Root Schema : Error
Type:
objectUsed when an API throws an Error, typically with a HTTP error response-code (3xx, 4xx, 5xx)
Show Source
-
@baseType: string
When sub-classing, this defines the super-class.
-
@schemaLocation: string
(uri)
A URI to a JSON-Schema file that defines additional attributes and relationships
-
@type: string
When sub-classing, this defines the sub-class entity name.
-
code(required): string
Application relevant detail, defined in the API or a common list.
-
message: string
More details and corrective actions related to the error which can be shown to a client user.
-
reason(required): string
Explanation of the reason for the error which can be shown to a client user.
-
referenceError: string
(uri)
URI of documentation describing the error.
-
status: string
HTTP Error code extension
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"
}