POST · Modifier avec OAuth
Rédigé par Red Blue
Mis à jour le
POST /api/v1/feedback/commands
operationId : feedback_command
Accès | Permission | Consentements OAuth |
|---|---|---|
OAuth : délégation d’un équipier pour l’API | feedback.update | api:connect, feedback:update |
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 |
X-Khony-Confirmation | header | Non | string ; uuid |
Champs du corps JSON
Nom | Emplacement | Requis | Type et contraintes |
|---|---|---|---|
productId | JSON | Oui | string |
request | JSON | Oui | object |
Variantes de la requête
Sélecteur | Valeur | Autres champs requis dans request |
|---|---|---|
request.operation | "properties" | postId, expectedRevision |
request.operation | "comment_create" | postId, expectedRevision, visibility |
request.operation | "comment_update" | postId, expectedRevision, commentId, expectedCommentRevision |
request.operation | "vote" | postId, expectedRevision, desired |
request.operation | "reaction" | postId, expectedRevision, commentId, expectedCommentRevision, emoji, desired |
request.operation | "contact_vote" | postId, expectedRevision, contactId |
request.operation | "view_create" | view |
request.operation | "view_update" | viewId, expectedViewHash, view |
request.operation | "view_delete" | viewId, expectedViewHash |
Choisissez une variante et respectez son schéma complet : les contraintes des champs optionnels et les unions imbriquées restent applicables.
Exemple de requête
curl --request POST "$KHONY_ORIGIN/api/v1/feedback/commands" \
--header "Authorization: Bearer $KHONY_ACCESS_TOKEN" \
--header 'Idempotency-Key: feedback-command-example-20261023' \
--header 'Content-Type: application/json' \
--data-raw '{
"productId": "product_01k3w8d7vhe008000000000001",
"request": {
"operation": "vote",
"postId": "post_01k3w8d7vhe008000000000001",
"expectedRevision": "4242",
"desired": true
}
}'Réponse de succès · HTTP 200
{
"data": {
"voted": true
}
}Schéma complet du corps JSON
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"productId": {
"type": "string",
"pattern": "^product_[0-7][0123456789abcdefghjkmnpqrstvwxyz]{25}$"
},
"request": {
"oneOf": [
{
"type": "object",
"properties": {
"operation": {
"$ref": "#/$defs/__schema0"
},
"postId": {
"$ref": "#/$defs/__schema1"
},
"expectedRevision": {
"$ref": "#/$defs/__schema2"
},
"boardId": {
"$ref": "#/$defs/__schema3"
},
"visibility": {
"$ref": "#/$defs/__schema4"
},
"tags": {
"$ref": "#/$defs/__schema5"
},
"assignment": {
"$ref": "#/$defs/__schema7"
}
},
"required": [
"operation",
"postId",
"expectedRevision"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"operation": {
"$ref": "#/$defs/__schema8"
},
"postId": {
"$ref": "#/$defs/__schema1"
},
"expectedRevision": {
"$ref": "#/$defs/__schema2"
},
"body": {
"$ref": "#/$defs/__schema9"
},
"bodyDocument": {
"$ref": "#/$defs/__schema10"
},
"parentId": {
"$ref": "#/$defs/__schema12"
},
"visibility": {
"$ref": "#/$defs/__schema14"
}
},
"required": [
"operation",
"postId",
"expectedRevision",
"visibility"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"operation": {
"$ref": "#/$defs/__schema15"
},
"postId": {
"$ref": "#/$defs/__schema1"
},
"expectedRevision": {
"$ref": "#/$defs/__schema2"
},
"commentId": {
"$ref": "#/$defs/__schema13"
},
"expectedCommentRevision": {
"$ref": "#/$defs/__schema2"
},
"body": {
"$ref": "#/$defs/__schema9"
},
"bodyDocument": {
"$ref": "#/$defs/__schema10"
}
},
"required": [
"operation",
"postId",
"expectedRevision",
"commentId",
"expectedCommentRevision"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"operation": {
"type": "string",
"const": "vote"
},
"postId": {
"$ref": "#/$defs/__schema1"
},
"expectedRevision": {
"$ref": "#/$defs/__schema2"
},
"desired": {
"type": "boolean"
}
},
"required": [
"operation",
"postId",
"expectedRevision",
"desired"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"operation": {
"type": "string",
"const": "reaction"
},
"postId": {
"$ref": "#/$defs/__schema1"
},
"expectedRevision": {
"$ref": "#/$defs/__schema2"
},
"commentId": {
"$ref": "#/$defs/__schema13"
},
"expectedCommentRevision": {
"$ref": "#/$defs/__schema2"
},
"emoji": {
"type": "string",
"minLength": 1,
"maxLength": 40
},
"desired": {
"type": "boolean"
}
},
"required": [
"operation",
"postId",
"expectedRevision",
"commentId",
"expectedCommentRevision",
"emoji",
"desired"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"operation": {
"type": "string",
"const": "contact_vote"
},
"postId": {
"$ref": "#/$defs/__schema1"
},
"expectedRevision": {
"$ref": "#/$defs/__schema2"
},
"contactId": {
"type": "string",
"pattern": "^contact_[0-7][0123456789abcdefghjkmnpqrstvwxyz]{25}$"
}
},
"required": [
"operation",
"postId",
"expectedRevision",
"contactId"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"operation": {
"type": "string",
"const": "view_create"
},
"view": {
"$ref": "#/$defs/__schema16"
}
},
"required": [
"operation",
"view"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"operation": {
"type": "string",
"const": "view_update"
},
"viewId": {
"type": "string",
"pattern": "^feedback_saved_view_[0-7][0123456789abcdefghjkmnpqrstvwxyz]{25}$"
},
"expectedViewHash": {
"type": "string",
"minLength": 64,
"maxLength": 64
},
"view": {
"$ref": "#/$defs/__schema16"
}
},
"required": [
"operation",
"viewId",
"expectedViewHash",
"view"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"operation": {
"type": "string",
"const": "view_delete"
},
"viewId": {
"type": "string",
"pattern": "^feedback_saved_view_[0-7][0123456789abcdefghjkmnpqrstvwxyz]{25}$"
},
"expectedViewHash": {
"type": "string",
"minLength": 64,
"maxLength": 64
}
},
"required": [
"operation",
"viewId",
"expectedViewHash"
],
"additionalProperties": false
}
]
}
},
"required": [
"productId",
"request"
],
"additionalProperties": false,
"$defs": {
"__schema0": {
"type": "string",
"const": "properties"
},
"__schema1": {
"type": "string",
"pattern": "^post_[0-7][0123456789abcdefghjkmnpqrstvwxyz]{25}$"
},
"__schema2": {
"type": "string",
"maxLength": 20,
"pattern": "^\\d+$"
},
"__schema3": {
"type": "string",
"pattern": "^board_[0-7][0123456789abcdefghjkmnpqrstvwxyz]{25}$"
},
"__schema4": {
"type": "string",
"enum": [
"public",
"internal"
]
},
"__schema5": {
"maxItems": 100,
"type": "array",
"items": {
"$ref": "#/$defs/__schema6"
}
},
"__schema6": {
"type": "object",
"properties": {
"name": {
"type": "string",
"minLength": 1,
"maxLength": 40
},
"color": {
"type": "string",
"enum": [
"gray",
"red",
"orange",
"yellow",
"green",
"blue",
"purple",
"pink"
]
},
"visibility": {
"type": "string",
"enum": [
"public",
"internal"
]
}
},
"required": [
"name",
"color"
],
"additionalProperties": false
},
"__schema7": {
"oneOf": [
{
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "none"
}
},
"required": [
"type"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "member"
},
"id": {
"type": "string",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
}
},
"required": [
"type",
"id"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "team"
},
"id": {
"type": "string",
"pattern": "^support_team_[0-7][0123456789abcdefghjkmnpqrstvwxyz]{25}$"
}
},
"required": [
"type",
"id"
],
"additionalProperties": false
}
]
},
"__schema8": {
"type": "string",
"const": "comment_create"
},
"__schema9": {
"default": "",
"type": "string",
"maxLength": 100000
},
"__schema10": {
"$ref": "#/$defs/__schema11"
},
"__schema11": {
"anyOf": [
{
"type": "string"
},
{
"type": "number"
},
{
"type": "boolean"
},
{
"type": "null"
},
{
"type": "array",
"items": {
"$ref": "#/$defs/__schema11"
}
},
{
"type": "object",
"propertyNames": {
"type": "string"
},
"additionalProperties": {
"$ref": "#/$defs/__schema11"
}
}
]
},
"__schema12": {
"$ref": "#/$defs/__schema13"
},
"__schema13": {
"type": "string",
"pattern": "^comment_[0-7][0123456789abcdefghjkmnpqrstvwxyz]{25}$"
},
"__schema14": {
"type": "string",
"enum": [
"public",
"internal"
]
},
"__schema15": {
"type": "string",
"const": "comment_update"
},
"__schema16": {
"type": "object",
"properties": {
"filters": {
"type": "object",
"properties": {
"boardIds": {
"maxItems": 100,
"type": "array",
"items": {
"$ref": "#/$defs/__schema17"
}
},
"tagIds": {
"maxItems": 100,
"type": "array",
"items": {
"$ref": "#/$defs/__schema18"
}
},
"tagMatch": {
"type": "string",
"enum": [
"any",
"all"
]
},
"statuses": {
"maxItems": 5,
"type": "array",
"items": {
"$ref": "#/$defs/__schema19"
}
},
"sort": {
"type": "string",
"enum": [
"recent",
"oldest",
"votes"
]
},
"sources": {
"maxItems": 5,
"type": "array",
"items": {
"$ref": "#/$defs/__schema20"
}
},
"dateField": {
"type": "string",
"enum": [
"created",
"updated"
]
},
"dateFrom": {
"type": "string",
"format": "date",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
},
"dateTo": {
"type": "string",
"format": "date",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
},
"minVotes": {
"type": "integer",
"minimum": 0,
"maximum": 100000000
},
"minRequesters": {
"type": "integer",
"minimum": 0,
"maximum": 100000000
},
"minInsights": {
"type": "integer",
"minimum": 0,
"maximum": 100000000
}
}
},
"query": {
"default": "",
"type": "string",
"maxLength": 160
},
"name": {
"type": "string",
"minLength": 1,
"maxLength": 60
}
},
"required": [
"filters",
"name"
]
},
"__schema17": {
"type": "string",
"pattern": "^board_[0-7][0123456789abcdefghjkmnpqrstvwxyz]{25}$"
},
"__schema18": {
"type": "string",
"pattern": "^tag_[0-7][0123456789abcdefghjkmnpqrstvwxyz]{25}$"
},
"__schema19": {
"type": "string",
"enum": [
"new",
"in_review",
"planned",
"completed",
"closed"
]
},
"__schema20": {
"type": "string",
"enum": [
"portal",
"widget",
"internal",
"api",
"import"
]
}
}
}Schéma complet de la réponse
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"data": {
"$ref": "#/$defs/__schema0"
}
},
"required": [
"data"
],
"additionalProperties": false,
"$defs": {
"__schema0": {
"anyOf": [
{
"type": "string"
},
{
"type": "number"
},
{
"type": "boolean"
},
{
"type": "null"
},
{
"type": "array",
"items": {
"$ref": "#/$defs/__schema0"
}
},
{
"type": "object",
"propertyNames": {
"type": "string"
},
"additionalProperties": {
"$ref": "#/$defs/__schema0"
}
}
]
}
}
}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
{
"description": "Dedicated API OAuth api:connect and the stated Feedback scope, actual delegated teammate, current organization/product consent and native role. Existing organization keys do not acquire these operations. Every admission consumes an API request. Send a stable Idempotency-Key and exactly the same body on uncertain-response retry; effect and durable actor/product/transport receipt commit together. Same key with changed data or stale expected post/comment/view state returns 409. Replay revalidates authority and never reapplies old effects. Complete ARTICLE bodyDocument is canonical for comment create/update; legacy body is a projection. Internal parents propagate visibility and public locks apply. vote/reaction take desired state for the actual principal. contact_vote is an explicit native vote for an existing contact, with actual teammate provenance. No arbitrary actor. View writes remain private to the current user with current hash."
}