Upload document

post

/documentManagement/v1/{documentManagementSystemId}/documents

This operation uploads the file to the underlying DMS/CMS.

Request

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

Response

Supported Media Types

201 Response

Document uploaded successfully
Body ()
Root Schema : DocumentUploadResponseBody
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 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"
}
Back to Top