Propose changes to a help center article
curl --request PUT \
--url http://localhost:8080/hc/{helpCenterId}/articles/{entityId}/diff \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"diff_html": "<string>",
"revision": 4503599627370495,
"base_version": "<string>",
"language_code": "<string>",
"title": "<string>"
}
'import requests
url = "http://localhost:8080/hc/{helpCenterId}/articles/{entityId}/diff"
payload = {
"diff_html": "<string>",
"revision": 4503599627370495,
"base_version": "<string>",
"language_code": "<string>",
"title": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
diff_html: '<string>',
revision: 4503599627370495,
base_version: '<string>',
language_code: '<string>',
title: '<string>'
})
};
fetch('http://localhost:8080/hc/{helpCenterId}/articles/{entityId}/diff', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "8080",
CURLOPT_URL => "http://localhost:8080/hc/{helpCenterId}/articles/{entityId}/diff",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'diff_html' => '<string>',
'revision' => 4503599627370495,
'base_version' => '<string>',
'language_code' => '<string>',
'title' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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 := "http://localhost:8080/hc/{helpCenterId}/articles/{entityId}/diff"
payload := strings.NewReader("{\n \"diff_html\": \"<string>\",\n \"revision\": 4503599627370495,\n \"base_version\": \"<string>\",\n \"language_code\": \"<string>\",\n \"title\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("http://localhost:8080/hc/{helpCenterId}/articles/{entityId}/diff")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"diff_html\": \"<string>\",\n \"revision\": 4503599627370495,\n \"base_version\": \"<string>\",\n \"language_code\": \"<string>\",\n \"title\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:8080/hc/{helpCenterId}/articles/{entityId}/diff")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"diff_html\": \"<string>\",\n \"revision\": 4503599627370495,\n \"base_version\": \"<string>\",\n \"language_code\": \"<string>\",\n \"title\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"artifact_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"article_entity_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"language_code": "<string>",
"title": "<string>",
"change_count": 0,
"revision": 0
}{
"message": "<string>",
"current_revision": 0,
"updated_by": 0,
"updated_at": "2023-11-07T05:31:56Z"
}{
"statusCode": 123,
"message": "<string>",
"error": "<string>"
}Articles
Propose changes to a help center article
Suggest changes to a help center article for review. The suggestions become the working draft in one language; an author accepts or rejects each one in the editor, then saves and publishes.
PUT
/
hc
/
{helpCenterId}
/
articles
/
{entityId}
/
diff
Propose changes to a help center article
curl --request PUT \
--url http://localhost:8080/hc/{helpCenterId}/articles/{entityId}/diff \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"diff_html": "<string>",
"revision": 4503599627370495,
"base_version": "<string>",
"language_code": "<string>",
"title": "<string>"
}
'import requests
url = "http://localhost:8080/hc/{helpCenterId}/articles/{entityId}/diff"
payload = {
"diff_html": "<string>",
"revision": 4503599627370495,
"base_version": "<string>",
"language_code": "<string>",
"title": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
diff_html: '<string>',
revision: 4503599627370495,
base_version: '<string>',
language_code: '<string>',
title: '<string>'
})
};
fetch('http://localhost:8080/hc/{helpCenterId}/articles/{entityId}/diff', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "8080",
CURLOPT_URL => "http://localhost:8080/hc/{helpCenterId}/articles/{entityId}/diff",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'diff_html' => '<string>',
'revision' => 4503599627370495,
'base_version' => '<string>',
'language_code' => '<string>',
'title' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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 := "http://localhost:8080/hc/{helpCenterId}/articles/{entityId}/diff"
payload := strings.NewReader("{\n \"diff_html\": \"<string>\",\n \"revision\": 4503599627370495,\n \"base_version\": \"<string>\",\n \"language_code\": \"<string>\",\n \"title\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("http://localhost:8080/hc/{helpCenterId}/articles/{entityId}/diff")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"diff_html\": \"<string>\",\n \"revision\": 4503599627370495,\n \"base_version\": \"<string>\",\n \"language_code\": \"<string>\",\n \"title\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:8080/hc/{helpCenterId}/articles/{entityId}/diff")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"diff_html\": \"<string>\",\n \"revision\": 4503599627370495,\n \"base_version\": \"<string>\",\n \"language_code\": \"<string>\",\n \"title\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"artifact_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"article_entity_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"language_code": "<string>",
"title": "<string>",
"change_count": 0,
"revision": 0
}{
"message": "<string>",
"current_revision": 0,
"updated_by": 0,
"updated_at": "2023-11-07T05:31:56Z"
}{
"statusCode": 123,
"message": "<string>",
"error": "<string>"
}Send the complete article body as an HTML fragment in
A block change adds, removes or replaces whole paragraphs, with
diff_html, with each change wrapped in suggestion markup. An inline change replaces a phrase:
<p>Refunds are available within <span data-diff-suggestion data-diff-suggestion-id="d1" data-diff-suggestion-comment="Policy changed"><span data-diff-suggestion-old>14 days</span><span data-diff-suggestion-new>30 days</span></span>.</p>
data-diff-suggestion-block, data-diff-suggestion-block-old and data-diff-suggestion-block-new on div elements. Leave an old or new part empty to suggest a pure addition or removal.
An inline change holds only text, formatting and whole links to other articles. To change the text of a link to another article, an image or a code block, wrap the whole paragraph or block in a block change instead; an inline change there is refused with 400. To change a collapsible section’s title, wrap the whole <details> element in a block change; a block change between its title and its body, or holding a title without its section, is refused with 400. In a list, change an item’s text with an inline change; a block change may follow the item’s text or wrap the whole list. A block change placed first in an item is turned into an inline change when each side holds a single paragraph with the same attributes, which are kept; otherwise, as for a side holding an image, it is refused with 400. A block change placed between items is refused with 400.
Read the article first with Get an article. Build on proposal_base.content_html: the working draft when there is one, otherwise the newest saved version, which may be newer than the live one. Send proposal_base.revision back as revision and proposal_base.base_version as base_version. If the draft changed, or a version was saved or retranslated, since you read it, the request is refused with 409 and nothing is written; read it again and rebuild the change.
The body replaces the whole working draft in that language: content left out of diff_html is removed from the draft. Nothing is saved as a version or published. A version can’t be saved, and the article can’t be published, until every suggestion is accepted or rejected. A body with no suggestion in it is refused with 400.
To propose a translation the article doesn’t have yet, pass that language_code and a title for it.Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Pattern:
^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$Pattern:
^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$Body
application/json
Minimum string length:
1Required range:
0 <= x <= 9007199254740991proposal_base.base_version from the read the proposal was built on. If the draft or a saved version changed since, the proposal is refused with 409.
Minimum string length:
2Minimum string length:
1Response
Default Response
Pattern:
^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$Pattern:
^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$Required range:
-9007199254740991 <= x <= 9007199254740991Required range:
-9007199254740991 <= x <= 9007199254740991Was this page helpful?