Patches the document with the specified ID.
Base Request
PATCH /api/documents/[docId]
where [docId] is the alphanumeric ID for the document.
Query Parameters
| Parameter | Description | Type | Required | Notes |
|---|---|---|---|---|
| condition | The HXQL predicate condition that must be met in order for calls to the endpoint to be executed successfully. | string | Optional | The specified HXQL condition can be simple or complex, as shown in
the following examples. However, it cannot include the
sys_path parameter, as this is not a real
value in the stored document.
|
Headers
| Header Name | Description | Required | Values |
|---|---|---|---|
| Authorization | The access token | Required |
Bearer [access_token]
where [access_token] is a string generated when you complete authentication (see Getting Started) |
| User-Agent | Identity of the client making the request to the server | Required |
[product]/[version]
where [product] is the name of the software you are using to make the request and [version] is the numbered version of the software (for example, MyCompanyProduct/1.0). For information on other types of values commonly included in user-agent request headers, see the User-Agent HTTP header reference section on the Mozilla developer documentation website. |
| HXCS-REPOSITORY | The repository ID | Optional | Any contributed repository name. Default is default. |
| Accept | The format of the data to be returned | Optional | application/vnd.hxcs.v1+json |
| Content-Type | The format of the data to be posted | Optional | application/json-patch+json |
Sample Request
PATCH /api/documents/[docId]?condition=my_version>12345 Authorization: Bearer [access_token] User-Agent: MyCompanyProduct/1.0 HXCS-REPOSITORY: default Accept: application/vnd.hxcs.v1+json Content-Type: application/json-patch+json
Response
See Document for response body details and a sample response.
Status Codes and Errors
The following table lists the returned status codes.
| Code | Description | Notes |
|---|---|---|
| 200 | OK | Patches and returns the document with the specified ID. |
| 400 | Bad Request | The server could not process the request due to an apparent client error, such as a malformed request syntax. |
| 401 | Not Authorized | Authentication has failed or was not provided. |
| 403 | Not Allowed | Access permissions are invalid or missing. |
| 404 | Not Found | The document could not be found. |
| 412 | Precondition Failed | The server did not allow the document to be patched because the specified condition was not met. |