BizKitHub
DokumentacjaEksplorator APIPost/api/v1/post/history/diff
getPostPubliczne API v1

/api/v1/post/history/diff

Returns a structured diff between two revisions of the same post and locale.

Title is word-grain (titles are short, word grain reads naturally), content is line-grain (HTML/markdown bodies — line grain keeps block edits readable). Each diff segment is tagged add / remove / context; concatenating context+add produces the to document, concatenating context+remove produces the from document.

Both revisions must belong to the same post and same locale; cross-post or cross-locale diffs return an error envelope.

postgetApiV1PostHistoryDiff

Parametry

3 w query

Parametry query

· 3
apiKeystringWymagane

Your BizKitHub API key (passed as GET parameter).

Key format: A 32-character string matching: ^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$
Prefixes: PROD (production key), DEV_ (individual developer), ROOT (system key with no limits). Learn more

PrzykładPRODPGrFxpGEtrOZfuWhnoJohUYBXuOE
fromstringWymagane

Older revision handle (left side of the diff).

PrzykładvErSiOnHaNdLe123
tostringWymagane

Newer revision handle (right side of the diff).

PrzykładvErSiOnHaNdLe456

Schemat odpowiedzi

1 udokumentowany kod statusu

200Sukces
object | object
Jedna z 2 opcji:
Wariant 1
fromobjectWymagane
idstringWymagane
insertedDateDate | string | string | numberWymagane
Jedna z 4 opcji:
Wariant 1
Date
Wariant 2
stringdate-time
Wariant 3
stringdate
Wariant 4
number
titlestringWymagane
contentSizenumberWymagane
localestringWymagane
authorobjectWymagane
idstring | nullWymagane
namestringWymagane
toobjectWymagane
idstringWymagane
insertedDateDate | string | string | numberWymagane
Jedna z 4 opcji:
Wariant 1
Date
Wariant 2
stringdate-time
Wariant 3
stringdate
Wariant 4
number
titlestringWymagane
contentSizenumberWymagane
localestringWymagane
authorobjectWymagane
idstring | nullWymagane
namestringWymagane
titleDiffobject[]Wymagane
Każdy element tablicy:
type"context" | "add" | "remove"Wymagane
valuestringWymagane
contentDiffobject[]Wymagane
Każdy element tablicy:
type"context" | "add" | "remove"Wymagane
valuestringWymagane
statsobjectWymagane
titleAddednumberWymagane
titleRemovednumberWymagane
contentAddedLinesnumberWymagane
contentRemovedLinesnumberWymagane
Wariant 2
state"error"Wymagane
messagestringWymagane
code"200"Wymagane
hintstring | nullWymagane

Przykład odpowiedzi

application/json
{
  "from": {
    "id": "example_id",
    "title": "example_title",
    "contentSize": 0,
    "locale": "example_locale",
    "author": {
      "name": "example_name"
    }
  },
  "to": {
    "id": "example_id",
    "title": "example_title",
    "contentSize": 0,
    "locale": "example_locale",
    "author": {
      "name": "example_name"
    }
  },
  "titleDiff": [
    {
      "value": "example_value"
    }
  ],
  "contentDiff": [
    {
      "value": "example_value"
    }
  ],
  "stats": {
    "titleAdded": 0,
    "titleRemoved": 0,
    "contentAddedLines": 0,
    "contentRemovedLines": 0
  }
}

Przykład żądania

GET /api/v1/post/history/diff

get
curl -X GET "https://api.bizkithub.com/api/v1/post/history/diff?apiKey=PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE&from=vErSiOnHaNdLe123&to=vErSiOnHaNdLe456" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY"

Potrzebujesz klucza API?

Wszystkie publiczne endpointy BizKitHub API uwierzytelniają się kluczem API.

Uzyskaj klucz API