PATCH · Modifier par clé

Feedback : Modifier par clé. Paramètres, accès et exemples de réponse.

Rédigé par Red Blue

Mis à jour le

Feedback

PATCH /api/v1/feedback/{postId}

operationId : feedback_update

Accès

Permission

Consentements OAuth

Clé API d’organisation

feedback.update

Sans objet

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

productId

query

Oui

string

Idempotency-Key

header

Oui

string ; Longueur maximale : 200

postId

path

Oui

string

Champs du corps JSON

Nom

Emplacement

Requis

Type et contraintes

boardId

JSON

Oui

string

title

JSON

Oui

string ; Longueur maximale : 160

body

JSON

Non

string ; Défaut : "" ; Longueur maximale : 100000

bodyDocument

JSON

Non

Voir le schéma complet

tags

JSON

Oui

array

expectedRevision

JSON

Oui

string ; Longueur maximale : 20

Exemple de requête

Shell
curl --request PATCH "$KHONY_ORIGIN/api/v1/feedback/post_01k3w8d7vhe008000000000003?productId=product_01k3w8d7vhe008000000000001" \
  --header "x-api-key: $KHONY_API_KEY" \
  --header 'Idempotency-Key: example-feedback-edit-43' \
  --header 'Content-Type: application/json' \
  --data-raw '{
  "boardId": "board_01k3w8d7vhe008000000000002",
  "title": "Add dark mode",
  "body": "## Proposed change\n\nPlease add a **dark theme**.",
  "tags": [],
  "expectedRevision": "4242"
}'
Shell

Réponse de succès · HTTP 200

JSON
{
  "data": {
    "id": "post_01k3w8d7vhe008000000000003",
    "productId": "product_01k3w8d7vhe008000000000001"
  }
}
JSON
Schéma complet du corps JSON
JSON
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "boardId": {
      "$ref": "#/$defs/__schema0"
    },
    "title": {
      "$ref": "#/$defs/__schema1"
    },
    "body": {
      "$ref": "#/$defs/__schema2"
    },
    "bodyDocument": {
      "$ref": "#/$defs/__schema3"
    },
    "tags": {
      "$ref": "#/$defs/__schema5"
    },
    "expectedRevision": {
      "$ref": "#/$defs/__schema7"
    }
  },
  "required": [
    "boardId",
    "title",
    "tags",
    "expectedRevision"
  ],
  "additionalProperties": false,
  "$defs": {
    "__schema0": {
      "type": "string",
      "pattern": "^board_[0-7][0123456789abcdefghjkmnpqrstvwxyz]{25}$"
    },
    "__schema1": {
      "type": "string",
      "minLength": 3,
      "maxLength": 160
    },
    "__schema2": {
      "default": "",
      "type": "string",
      "maxLength": 100000
    },
    "__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": {
      "maxItems": 10,
      "type": "array",
      "items": {
        "$ref": "#/$defs/__schema6"
      }
    },
    "__schema6": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "minLength": 1,
          "maxLength": 40
        },
        "color": {
          "type": "string",
          "enum": [
            "gray",
            "red",
            "amber",
            "green",
            "blue",
            "violet",
            "pink"
          ]
        }
      },
      "required": [
        "name",
        "color"
      ]
    },
    "__schema7": {
      "type": "string",
      "maxLength": 20,
      "pattern": "^\\d+$"
    }
  }
}
JSON
Schéma complet de la réponse
JSON
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "data": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "pattern": "^post_[0-7][0123456789abcdefghjkmnpqrstvwxyz]{25}$"
        },
        "productId": {
          "type": "string",
          "pattern": "^product_[0-7][0123456789abcdefghjkmnpqrstvwxyz]{25}$"
        }
      },
      "required": [
        "id",
        "productId"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "data"
  ],
  "additionalProperties": false
}
JSON

Refus et reprise

Les statuts documentés pour cette opération sont 400, 401, 402, 403, 404, 409, 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": "Requires an explicitly authorized feedback-editor organization key and product API entitlement. Read the canonical ID and revision with feedback_get. Replace title, body, board and the complete tag list; [] clears tags. Supply expectedRevision and a new stable Idempotency-Key. A recorded identical command returns its historic ID without overwriting later edits. A stale revision or changed command payload returns 409. API and MCP command namespaces are separate. bodyDocument is the full canonical article JSON, shared with the native article editor and reader. When supplied it is authoritative and body is a derived text projection. Read and preserve the complete document when editing rich content; legacy text-only input remains compatible. No status, visibility or arbitrary author. Each HTTP admission consumes an API request even when replayed."
}
JSON