POST · Créer

Feedback : Créer. Paramètres, accès et exemples de réponse.

Rédigé par Red Blue

Mis à jour le

Feedback

POST /api/v1/feedback

operationId : feedback_create

Accès

Permission

Consentements OAuth

Clé API d’organisation

feedback.create

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

Idempotency-Key

header

Non

string ; Longueur maximale : 200

X-Khony-Webhook-Id

header

Non

string

Champs du corps JSON

Nom

Emplacement

Requis

Type et contraintes

productId

JSON

Oui

string

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

Non

array ; Défaut : []

Exemple de requête

Shell
curl --request POST "$KHONY_ORIGIN/api/v1/feedback" \
  --header "x-api-key: $KHONY_API_KEY" \
  --header 'Idempotency-Key: example-source-event-42' \
  --header 'Content-Type: application/json' \
  --data-raw '{
  "productId": "product_01k3w8d7vhe008000000000001",
  "boardId": "board_01k3w8d7vhe008000000000002",
  "title": "Add dark mode",
  "body": "Please add a dark theme to the public portal.",
  "tags": []
}'
Shell

Réponse de succès · HTTP 201

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

Refus et reprise

Les statuts documentés pour cette opération sont 400, 401, 402, 403, 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 the public API entitlement and product write access. Send a stable Idempotency-Key and the exact same payload when retrying a command after an uncertain response. A changed payload returns 409. Every HTTP admission consumes a separate API request even when its business command is replayed. X-Request-ID is correlation only. Webhook-origin headers must refer to a verified delivery of this product. Durable events are committed transactionally; cache/realtime work may fail afterward, in which case retry with the same command key. Realtime notifications may repeat."
}
JSON