POST · Icônes

Roadmaps : Icônes. Paramètres, accès et exemples de réponse.

Rédigé par Red Blue

Mis à jour le

Roadmaps

POST /api/v1/roadmaps/icons

operationId : roadmap_icon

Accès

Permission

Consentements OAuth

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

roadmap.update

api:connect, roadmap: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

Non

string ; uuid

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

idempotencyKey

JSON

Oui

string ; uuid

Exemple de requête

Shell
curl --request POST "$KHONY_ORIGIN/api/v1/roadmaps/icons" \
  --header "Authorization: Bearer $KHONY_ACCESS_TOKEN" \
  --header 'Idempotency-Key: 0198f886-9f71-7000-8000-000000000010' \
  --header 'X-Khony-Confirmation: 0198f886-9f71-7000-8000-000000000011' \
  --header 'Content-Type: application/json' \
  --data-raw '{
  "productId": "product_01k3w8d7vhe008000000000001",
  "idempotencyKey": "0198f886-9f71-7000-8000-000000000010",
  "request": {
    "contentType": "image/png",
    "dataBase64": "iVBORw0KGgo="
  }
}'
Shell

Réponse de succès · HTTP 200

JSON
{
  "data": {
    "url": "/api/roadmap-icons/0198f886-9f71-7000-8000-000000000001/0198f886-9f71-7000-8000-000000000003"
  }
}
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": {
        "contentType": {
          "type": "string",
          "enum": [
            "image/png",
            "image/jpeg",
            "image/webp"
          ]
        },
        "dataBase64": {
          "type": "string",
          "minLength": 1,
          "maxLength": 349528,
          "pattern": "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$"
        }
      },
      "required": [
        "contentType",
        "dataBase64"
      ],
      "additionalProperties": false
    },
    "idempotencyKey": {
      "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": [
    "productId",
    "request",
    "idempotencyKey"
  ],
  "additionalProperties": false
}
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": {
        "url": {
          "type": "string"
        }
      },
      "required": [
        "url"
      ],
      "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, 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 plus the explicit Roadmap scope and current native human product authority; technical keys/cookies are refused. Native organization/product, API entitlement, billing and request admission apply. roadmap:write and native administrator, verified human confirmation with exact arguments and idempotencyKey. Native PNG/JPEG/WebP signature and 256-KiB decoded limit. Returns the native URL for use in columns. This storage operation is not response-replay-safe: the key binds confirmation, not a SQL receipt. An uncertain retry can create an unused icon; reuse a known returned URL and inspect the Roadmap before repeating. Object storage and PostgreSQL are separate effects; no atomic remote commit is claimed."
}
JSON