Upload document
/documentManagement/v1/{documentManagementSystemId}/documents
Request
-
documentManagementSystemId(required): string
Unique identifier for DMS/CMS as configured in the CXIF routing GKR criteria
- multipart/form-data
object-
folderId(required): string
Example:
DB1C5AF480FFE61C588027A8T000000000010000331
Response
- application/json
201 Response
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
400 Response
object-
@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
object-
@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
object-
@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
object-
@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 document by submitting a post request on the REST resource using cURL.
cURL Command
curl --<username:password> --request POST
'{FABRIC_HOST}/api/documentManagement/v1/OCM1/documents/' --header 'Authorization: Bearer
<access_token>' --form 'folderData={"folderId" :
"FB4CD874EF94CD2CC1B60B72T0000000000100000001"};type=application/json' --form
'file=@"/C:/Users/user_name/sample_files/test_file.pdf"'
Example of Request Body
The following shows an example of the request body in JSON format.
------------------------------362052356708186529598553--
Content-Disposition: form-data; name="folderData"
Content-Type: application/json
{
"folderId":"FB4CD874EF94CD2CC1B60B72T0000000000100000001"
}
------------------------------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=123",
"version": "1"
}