POST · Modifier un brouillon

Changelog : Modifier un brouillon. Paramètres, accès et exemples de réponse.

Rédigé par Red Blue

Mis à jour le

Changelog

POST /api/v1/changelog/update

operationId : changelog_update

Accès

Permission

Consentements OAuth

OAuth : délégation d’un équipier pour l’API

changelog.update

api:connect, changelog:write

KHONY_ORIGIN est l’origine HTTPS de votre application Khony, sans chemin final. Remplacez les identifiants de l’exemple par ceux de vos ressources autorisées. Les données de réponse ci-dessous illustrent le format ; elles ne sont pas le résultat d’un appel à votre organisation.

Paramètres et en-têtes

Nom

Emplacement

Requis

Type et contraintes

Idempotency-Key

header

Oui

string ; Longueur maximale : 200

Champs du corps JSON

Nom

Emplacement

Requis

Type et contraintes

productId

JSON

Oui

string

request

JSON

Oui

object

Exemple de requête

Shell
curl --request POST "$KHONY_ORIGIN/api/v1/changelog/update" \
  --header "Authorization: Bearer $KHONY_ACCESS_TOKEN" \
  --header 'Idempotency-Key: changelog-command-example' \
  --header 'Content-Type: application/json' \
  --data-raw '{
  "productId": "product_01k3w8d7vhe008000000000001",
  "request": {
    "title": "Nouvelle amélioration",
    "bodyContent": {
      "type": "doc",
      "content": [
        {
          "type": "paragraph",
          "content": [
            {
              "type": "text",
              "text": "Une amélioration disponible."
            }
          ]
        }
      ]
    },
    "locale": "fr",
    "feedbackIds": [
      "post_01k3w8d7vhe008000000000003"
    ],
    "entryId": "changelog_01k3w8d7vhe008000000000002",
    "expectedRevision": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
  }
}'
Shell

Réponse de succès · HTTP 200

JSON
{
  "operation": "update",
  "accepted": true,
  "entryId": "changelog_01k3w8d7vhe008000000000002",
  "revision": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
}
JSON
Schéma complet du corps JSON
JSON
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "productId": {
      "type": "string",
      "pattern": "^product_[0-7][0123456789abcdefghjkmnpqrstvwxyz]{25}$"
    },
    "request": {
      "type": "object",
      "properties": {
        "entryId": {
          "$ref": "#/$defs/__schema0"
        },
        "expectedRevision": {
          "$ref": "#/$defs/__schema1"
        },
        "title": {
          "$ref": "#/$defs/__schema2"
        },
        "bodyContent": {
          "$ref": "#/$defs/__schema3"
        },
        "locale": {
          "$ref": "#/$defs/__schema5"
        },
        "feedbackIds": {
          "$ref": "#/$defs/__schema6"
        },
        "expectedTransform": {
          "$ref": "#/$defs/__schema8"
        }
      },
      "required": [
        "entryId",
        "expectedRevision",
        "title",
        "bodyContent",
        "feedbackIds"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "productId",
    "request"
  ],
  "additionalProperties": false,
  "$defs": {
    "__schema0": {
      "type": "string",
      "pattern": "^changelog_[0-7][0123456789abcdefghjkmnpqrstvwxyz]{25}$"
    },
    "__schema1": {
      "type": "string",
      "pattern": "^[a-f0-9]{64}$"
    },
    "__schema2": {
      "type": "string",
      "minLength": 2,
      "maxLength": 160
    },
    "__schema3": {
      "$ref": "#/$defs/__schema4"
    },
    "__schema4": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "number"
        },
        {
          "type": "boolean"
        },
        {
          "type": "null"
        },
        {
          "type": "array",
          "items": {
            "$ref": "#/$defs/__schema4"
          }
        },
        {
          "type": "object",
          "propertyNames": {
            "type": "string"
          },
          "additionalProperties": {
            "$ref": "#/$defs/__schema4"
          }
        }
      ]
    },
    "__schema5": {
      "type": "string"
    },
    "__schema6": {
      "maxItems": 500,
      "type": "array",
      "items": {
        "$ref": "#/$defs/__schema7"
      }
    },
    "__schema7": {
      "type": "string",
      "pattern": "^post_[0-7][0123456789abcdefghjkmnpqrstvwxyz]{25}$"
    },
    "__schema8": {
      "type": "object",
      "properties": {
        "sourceLocale": {
          "$ref": "#/$defs/__schema9"
        },
        "sourceVersion": {
          "type": "string",
          "enum": [
            "draft",
            "published"
          ]
        },
        "sourceRevision": {
          "type": "integer",
          "minimum": -1,
          "maximum": 9007199254740991
        },
        "sourceIdentity": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 1500000
            },
            {
              "type": "null"
            }
          ]
        },
        "targetLocale": {
          "$ref": "#/$defs/__schema9"
        },
        "targetRevision": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "targetIdentity": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 1500000
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "sourceLocale",
        "sourceVersion",
        "sourceRevision",
        "sourceIdentity",
        "targetLocale",
        "targetRevision",
        "targetIdentity"
      ]
    },
    "__schema9": {
      "type": "string",
      "minLength": 2,
      "maxLength": 35
    }
  }
}
JSON
Schéma complet de la réponse
JSON
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "operation": {
      "type": "string",
      "enum": [
        "create",
        "update",
        "publish",
        "delete"
      ]
    },
    "accepted": {
      "type": "boolean",
      "const": true
    },
    "entryId": {
      "type": "string",
      "pattern": "^changelog_[0-7][0123456789abcdefghjkmnpqrstvwxyz]{25}$"
    },
    "revision": {
      "anyOf": [
        {
          "type": "string",
          "minLength": 64,
          "maxLength": 64
        },
        {
          "type": "null"
        }
      ]
    }
  },
  "required": [
    "operation",
    "accepted",
    "entryId",
    "revision"
  ],
  "additionalProperties": false
}
JSON

Refus et reprise

Les statuts documentés pour cette opération sont 400, 401, 402, 403, 404, 409, 428, 429, 500, 503. Identifiez la cause avec error.code et, lorsqu’il est présent, error.reason. Une réponse 409 peut demander une relecture de révision ou signaler une commande incompatible ; une réponse 428 demande une confirmation humaine. Ne rejouez une écriture que selon son contrat.

Notes du contrat
JSON
{
  "description": "Dedicated API OAuth api:connect and explicit operation scope, current native role permission and consented product are mandatory. Organization keys and browser cookies are rejected. Shared API admission, public API entitlement and meter apply. Administrator access is additionally required. Supply a stable Idempotency-Key. Current permissions and billing are rechecked before receipt replay. Update/publish/delete/translate require the exact revision from detail. Source publication precedes translations. First source publication queues one native event; queueing never promises delivery. Rich input follows the native HTTP ceiling of 128 MiB; infrastructure and memory limits still apply. Native ARTICLE and transform guard validation are unchanged. Saves a native locale draft and source Feedback selection. Existing published content and published links remain unchanged until explicit publication. expectedTransform verifies native source and target revisions before applying an AI proposal."
}
JSON