POST · Publier

Changelog : Publier. Paramètres, accès et exemples de réponse.

Rédigé par Red Blue

Mis à jour le

Changelog

POST /api/v1/changelog/publish

operationId : changelog_publish

Accès

Permission

Consentements OAuth

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

changelog.publish

api:connect, changelog:publish

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/publish" \
  --header "Authorization: Bearer $KHONY_ACCESS_TOKEN" \
  --header 'Idempotency-Key: changelog-command-example' \
  --header 'X-Khony-Confirmation: 0198f886-9f71-7000-8000-000000000011' \
  --header 'Content-Type: application/json' \
  --data-raw '{
  "productId": "product_01k3w8d7vhe008000000000001",
  "request": {
    "entryId": "changelog_01k3w8d7vhe008000000000002",
    "expectedRevision": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
    "locale": "fr"
  }
}'
Shell

Réponse de succès · HTTP 200

JSON
{
  "operation": "publish",
  "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": {
          "type": "string",
          "pattern": "^changelog_[0-7][0123456789abcdefghjkmnpqrstvwxyz]{25}$"
        },
        "expectedRevision": {
          "type": "string",
          "pattern": "^[a-f0-9]{64}$"
        },
        "locale": {
          "type": "string"
        }
      },
      "required": [
        "entryId",
        "expectedRevision"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "productId",
    "request"
  ],
  "additionalProperties": false
}
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. Requires real human confirmation (HTTP428), bound to session, delegation, action, product, arguments and key. Published content is the saved locale draft; source links and first-publication outbox are native. Republishing or translating does not resend first-publication notifications."
}
JSON