Updates a document.
Send only what changes. A changed Title or Body is saved as a new version.
StatusId 2 archives the document and every document below it, at any depth; 1
restores an archived document to the top level, and the documents below it stay archived.
Move puts the document under another parent, or at the top level of a client (or
internal), last among its new siblings, and gives everything nested under it the same client.
Attachments replaces the whole list: upload each file with POST /v1/attachments
and send every name and url, including the ones to keep. An empty array removes them all.
curl --request PATCH \
--url https://api.usw.gorelo.io/v1/documents/{documentId} \
--header 'Content-Type: application/json-patch+json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"Title": "<string>",
"Body": "<string>",
"IsStarred": true,
"PublicLinkEnabled": true,
"PublishToPortalEnabled": true,
"AlternateName": "<string>",
"StatusId": 123,
"Attachments": [
{
"Name": "<string>",
"Url": "<string>"
}
],
"Move": {
"ParentDocumentId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"ClientId": 123
}
}
'import requests
url = "https://api.usw.gorelo.io/v1/documents/{documentId}"
payload = {
"Title": "<string>",
"Body": "<string>",
"IsStarred": True,
"PublicLinkEnabled": True,
"PublishToPortalEnabled": True,
"AlternateName": "<string>",
"StatusId": 123,
"Attachments": [
{
"Name": "<string>",
"Url": "<string>"
}
],
"Move": {
"ParentDocumentId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"ClientId": 123
}
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json-patch+json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json-patch+json'},
body: JSON.stringify({
Title: '<string>',
Body: '<string>',
IsStarred: true,
PublicLinkEnabled: true,
PublishToPortalEnabled: true,
AlternateName: '<string>',
StatusId: 123,
Attachments: [{Name: '<string>', Url: '<string>'}],
Move: {ParentDocumentId: '3c90c3cc-0d44-4b50-8888-8dd25736052a', ClientId: 123}
})
};
fetch('https://api.usw.gorelo.io/v1/documents/{documentId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.usw.gorelo.io/v1/documents/{documentId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'Title' => '<string>',
'Body' => '<string>',
'IsStarred' => true,
'PublicLinkEnabled' => true,
'PublishToPortalEnabled' => true,
'AlternateName' => '<string>',
'StatusId' => 123,
'Attachments' => [
[
'Name' => '<string>',
'Url' => '<string>'
]
],
'Move' => [
'ParentDocumentId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'ClientId' => 123
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json-patch+json",
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.usw.gorelo.io/v1/documents/{documentId}"
payload := strings.NewReader("{\n \"Title\": \"<string>\",\n \"Body\": \"<string>\",\n \"IsStarred\": true,\n \"PublicLinkEnabled\": true,\n \"PublishToPortalEnabled\": true,\n \"AlternateName\": \"<string>\",\n \"StatusId\": 123,\n \"Attachments\": [\n {\n \"Name\": \"<string>\",\n \"Url\": \"<string>\"\n }\n ],\n \"Move\": {\n \"ParentDocumentId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"ClientId\": 123\n }\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json-patch+json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.usw.gorelo.io/v1/documents/{documentId}")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json-patch+json")
.body("{\n \"Title\": \"<string>\",\n \"Body\": \"<string>\",\n \"IsStarred\": true,\n \"PublicLinkEnabled\": true,\n \"PublishToPortalEnabled\": true,\n \"AlternateName\": \"<string>\",\n \"StatusId\": 123,\n \"Attachments\": [\n {\n \"Name\": \"<string>\",\n \"Url\": \"<string>\"\n }\n ],\n \"Move\": {\n \"ParentDocumentId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"ClientId\": 123\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.usw.gorelo.io/v1/documents/{documentId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json-patch+json'
request.body = "{\n \"Title\": \"<string>\",\n \"Body\": \"<string>\",\n \"IsStarred\": true,\n \"PublicLinkEnabled\": true,\n \"PublishToPortalEnabled\": true,\n \"AlternateName\": \"<string>\",\n \"StatusId\": 123,\n \"Attachments\": [\n {\n \"Name\": \"<string>\",\n \"Url\": \"<string>\"\n }\n ],\n \"Move\": {\n \"ParentDocumentId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"ClientId\": 123\n }\n}"
response = http.request(request)
puts response.read_body{
"StatusCode": 100,
"IsSuccess": true,
"Data": {
"Id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"Title": "<string>",
"Body": "<string>",
"ParentDocumentId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"RootDocumentId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"Depth": 123,
"ChildCount": 123,
"DocumentOrder": 123,
"Children": [
{
"Id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"Title": "<string>",
"ChildCount": 123
}
],
"ClientId": 123,
"IsStarred": true,
"PublicLinkEnabled": true,
"PublicLinkUrl": "<string>",
"PublishToPortalEnabled": true,
"AlternateName": "<string>",
"Status": {
"Id": 1,
"Name": "<string>"
},
"Attachments": [
{
"Name": "<string>",
"Url": "<string>"
}
],
"RelatedItems": [
{
"Id": 123,
"ItemId": "<string>",
"ItemType": {
"Id": 1,
"Name": "<string>"
}
}
],
"CreatedOn": "2023-11-07T05:31:56Z",
"CreatedById": 123,
"UpdatedOn": "2023-11-07T05:31:56Z",
"UpdatedById": 123
},
"DataContext": null,
"Notifications": [
{
"Code": "070101",
"Message": "<string>",
"PropertyName": "<string>",
"ActionHint": "<string>",
"DocUrl": "<string>"
}
]
}{
"StatusCode": 100,
"IsSuccess": true,
"Data": null,
"DataContext": {
"TraceId": "<string>"
},
"Notifications": [
{
"Code": "070101",
"Message": "<string>",
"PropertyName": "<string>",
"ActionHint": "<string>",
"DocUrl": "<string>"
}
]
}{
"StatusCode": 100,
"IsSuccess": true,
"Data": null,
"DataContext": {
"TraceId": "<string>"
},
"Notifications": [
{
"Code": "070101",
"Message": "<string>",
"PropertyName": "<string>",
"ActionHint": "<string>",
"DocUrl": "<string>"
}
]
}{
"StatusCode": 100,
"IsSuccess": true,
"Data": null,
"DataContext": {
"TraceId": "<string>"
},
"Notifications": [
{
"Code": "070101",
"Message": "<string>",
"PropertyName": "<string>",
"ActionHint": "<string>",
"DocUrl": "<string>"
}
]
}{
"StatusCode": 100,
"IsSuccess": true,
"Data": null,
"DataContext": {
"TraceId": "<string>"
},
"Notifications": [
{
"Code": "070101",
"Message": "<string>",
"PropertyName": "<string>",
"ActionHint": "<string>",
"DocUrl": "<string>"
}
]
}Autoritzacions
Your Gorelo API key. See Generate API key. If your data is hosted in Australia, click the base URL at the top of this page and select https://api.aue.gorelo.io.
Cos
Fields to change.
Partial update of a document. Every field is optional; an omitted or null field is left as it
is. Clearing, per field: AlternateName clears with an empty string; Attachments
clears with an empty array; Title cannot be cleared.
Resposta
OK
100, 101, 102, 103, 200, 201, 202, 203, 204, 205, 206, 207, 208, 226, 300, 301, 302, 303, 304, 305, 306, 307, 308, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 421, 422, 423, 424, 426, 428, 429, 431, 451, 500, 501, 502, 503, 504, 505, 506, 507, 508, 510, 511 Aquesta pàgina us ha estat útil?
curl --request PATCH \
--url https://api.usw.gorelo.io/v1/documents/{documentId} \
--header 'Content-Type: application/json-patch+json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"Title": "<string>",
"Body": "<string>",
"IsStarred": true,
"PublicLinkEnabled": true,
"PublishToPortalEnabled": true,
"AlternateName": "<string>",
"StatusId": 123,
"Attachments": [
{
"Name": "<string>",
"Url": "<string>"
}
],
"Move": {
"ParentDocumentId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"ClientId": 123
}
}
'import requests
url = "https://api.usw.gorelo.io/v1/documents/{documentId}"
payload = {
"Title": "<string>",
"Body": "<string>",
"IsStarred": True,
"PublicLinkEnabled": True,
"PublishToPortalEnabled": True,
"AlternateName": "<string>",
"StatusId": 123,
"Attachments": [
{
"Name": "<string>",
"Url": "<string>"
}
],
"Move": {
"ParentDocumentId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"ClientId": 123
}
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json-patch+json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json-patch+json'},
body: JSON.stringify({
Title: '<string>',
Body: '<string>',
IsStarred: true,
PublicLinkEnabled: true,
PublishToPortalEnabled: true,
AlternateName: '<string>',
StatusId: 123,
Attachments: [{Name: '<string>', Url: '<string>'}],
Move: {ParentDocumentId: '3c90c3cc-0d44-4b50-8888-8dd25736052a', ClientId: 123}
})
};
fetch('https://api.usw.gorelo.io/v1/documents/{documentId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.usw.gorelo.io/v1/documents/{documentId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'Title' => '<string>',
'Body' => '<string>',
'IsStarred' => true,
'PublicLinkEnabled' => true,
'PublishToPortalEnabled' => true,
'AlternateName' => '<string>',
'StatusId' => 123,
'Attachments' => [
[
'Name' => '<string>',
'Url' => '<string>'
]
],
'Move' => [
'ParentDocumentId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'ClientId' => 123
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json-patch+json",
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.usw.gorelo.io/v1/documents/{documentId}"
payload := strings.NewReader("{\n \"Title\": \"<string>\",\n \"Body\": \"<string>\",\n \"IsStarred\": true,\n \"PublicLinkEnabled\": true,\n \"PublishToPortalEnabled\": true,\n \"AlternateName\": \"<string>\",\n \"StatusId\": 123,\n \"Attachments\": [\n {\n \"Name\": \"<string>\",\n \"Url\": \"<string>\"\n }\n ],\n \"Move\": {\n \"ParentDocumentId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"ClientId\": 123\n }\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json-patch+json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.usw.gorelo.io/v1/documents/{documentId}")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json-patch+json")
.body("{\n \"Title\": \"<string>\",\n \"Body\": \"<string>\",\n \"IsStarred\": true,\n \"PublicLinkEnabled\": true,\n \"PublishToPortalEnabled\": true,\n \"AlternateName\": \"<string>\",\n \"StatusId\": 123,\n \"Attachments\": [\n {\n \"Name\": \"<string>\",\n \"Url\": \"<string>\"\n }\n ],\n \"Move\": {\n \"ParentDocumentId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"ClientId\": 123\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.usw.gorelo.io/v1/documents/{documentId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json-patch+json'
request.body = "{\n \"Title\": \"<string>\",\n \"Body\": \"<string>\",\n \"IsStarred\": true,\n \"PublicLinkEnabled\": true,\n \"PublishToPortalEnabled\": true,\n \"AlternateName\": \"<string>\",\n \"StatusId\": 123,\n \"Attachments\": [\n {\n \"Name\": \"<string>\",\n \"Url\": \"<string>\"\n }\n ],\n \"Move\": {\n \"ParentDocumentId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"ClientId\": 123\n }\n}"
response = http.request(request)
puts response.read_body{
"StatusCode": 100,
"IsSuccess": true,
"Data": {
"Id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"Title": "<string>",
"Body": "<string>",
"ParentDocumentId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"RootDocumentId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"Depth": 123,
"ChildCount": 123,
"DocumentOrder": 123,
"Children": [
{
"Id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"Title": "<string>",
"ChildCount": 123
}
],
"ClientId": 123,
"IsStarred": true,
"PublicLinkEnabled": true,
"PublicLinkUrl": "<string>",
"PublishToPortalEnabled": true,
"AlternateName": "<string>",
"Status": {
"Id": 1,
"Name": "<string>"
},
"Attachments": [
{
"Name": "<string>",
"Url": "<string>"
}
],
"RelatedItems": [
{
"Id": 123,
"ItemId": "<string>",
"ItemType": {
"Id": 1,
"Name": "<string>"
}
}
],
"CreatedOn": "2023-11-07T05:31:56Z",
"CreatedById": 123,
"UpdatedOn": "2023-11-07T05:31:56Z",
"UpdatedById": 123
},
"DataContext": null,
"Notifications": [
{
"Code": "070101",
"Message": "<string>",
"PropertyName": "<string>",
"ActionHint": "<string>",
"DocUrl": "<string>"
}
]
}{
"StatusCode": 100,
"IsSuccess": true,
"Data": null,
"DataContext": {
"TraceId": "<string>"
},
"Notifications": [
{
"Code": "070101",
"Message": "<string>",
"PropertyName": "<string>",
"ActionHint": "<string>",
"DocUrl": "<string>"
}
]
}{
"StatusCode": 100,
"IsSuccess": true,
"Data": null,
"DataContext": {
"TraceId": "<string>"
},
"Notifications": [
{
"Code": "070101",
"Message": "<string>",
"PropertyName": "<string>",
"ActionHint": "<string>",
"DocUrl": "<string>"
}
]
}{
"StatusCode": 100,
"IsSuccess": true,
"Data": null,
"DataContext": {
"TraceId": "<string>"
},
"Notifications": [
{
"Code": "070101",
"Message": "<string>",
"PropertyName": "<string>",
"ActionHint": "<string>",
"DocUrl": "<string>"
}
]
}{
"StatusCode": 100,
"IsSuccess": true,
"Data": null,
"DataContext": {
"TraceId": "<string>"
},
"Notifications": [
{
"Code": "070101",
"Message": "<string>",
"PropertyName": "<string>",
"ActionHint": "<string>",
"DocUrl": "<string>"
}
]
}