Updating an existing document
On this page
Use this API method to update an existing document or folder. The result is in JSON format and contains the list of attributes of the updated document.
Request URL
The request URL takes the following form:
PUT <ROOT>/rest/stonikbyte-documents-api/1.0/document/{documentID}
Parameters
Parameter | Description |
---|---|
{documentID} | The id of the document to be updated |
Also, the body of the request must contain a JSON with the modified attributes of the document.
Data | Description | Example |
---|---|---|
title | Required. The Title of the document. | "Market Requirements Document" |
originalFileName | Applicable only for documents of type File. The name of the attached file. | "mrd.docx" |
uploadedFileID | Applicable only for documents of type File. To obtain the ID you have to upload the file first - see Uploading a file attachment section below | |
targetURL | Applicable only for documents of type URL. The target URL for documents of type URL. | |
description | The Description of the document. | "This document describes the market requirements." |
currentRevision | The Current Revision field of the document. | "1.0" |
currentRevisionDescription | The Revision Notes field of the document. | "First draft" |
currentRevisionAuthors | The Revision Author(s) field of the document. | "John Smith" |
currentRevisionDate | The Revision Date field of the document. It must be in YYYY-MM-DD format. | "2016-12-25" |
A successful response
An HTTP 200 status response indicates a successful request. The result in JSON format will contain the list with the attributes of the updated document. See Obtaining the attributes of a document for a description of these attributes.
Error Response
If the REST call fails, the service returns one of the following HTTP statuses:
HTTP Status Code | Description |
---|---|
401 Unauthorized | Returned for unauthenticated requests or in case of invalid Documents app license |
403 Forbidden | If the user does not have View permissions |
400 Bad Request | In case of invalid parameters. |
404 Not found | If the document no longer exists. |
Â