POST · Inspecter les brouillons

Centre d’aide : Inspecter les brouillons. Paramètres, accès et exemples de réponse.

Rédigé par Red Blue

Mis à jour le

Centre d’aide

POST /api/v1/knowledge/management/read

operationId : knowledge_inspect

Accès

Permission

Consentements OAuth

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

knowledge.inspect

api:connect, knowledge:inspect

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.

Champs du corps JSON

Nom

Emplacement

Requis

Type et contraintes

productId

JSON

Oui

string

request

JSON

Oui

object

contentCursor

JSON

Non

object

Variantes de la requête

Sélecteur

Valeur

Autres champs requis dans request

request.view

"navigation"

Aucun autre champ imposé

request.view

"articles"

Aucun autre champ imposé

request.view

"article"

articleId

request.view

"order"

collectionId

request.view

"imports"

Aucun autre champ imposé

request.view

"import"

documentId

request.view

"extraction_capabilities"

Aucun autre champ imposé

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

Shell
curl --request POST "$KHONY_ORIGIN/api/v1/knowledge/management/read" \
  --header "Authorization: Bearer $KHONY_ACCESS_TOKEN" \
  --header 'Content-Type: application/json' \
  --data-raw '{
  "productId": "product_01k3w8d7vhe008000000000001",
  "request": {
    "view": "articles",
    "status": "draft"
  }
}'
Shell

Réponse de succès · HTTP 200

JSON
{
  "format": "json",
  "content": "{\"articles\":[],\"nextCursor\":null}",
  "nextCursor": null
}
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": {
      "oneOf": [
        {
          "type": "object",
          "properties": {
            "view": {
              "type": "string",
              "const": "navigation"
            }
          },
          "required": [
            "view"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "view": {
              "type": "string",
              "const": "articles"
            },
            "cursor": {
              "type": "string",
              "maxLength": 9,
              "pattern": "^\\d+$"
            },
            "query": {
              "type": "string",
              "maxLength": 160
            },
            "status": {
              "type": "string",
              "enum": [
                "draft",
                "published"
              ]
            },
            "visibility": {
              "type": "string",
              "enum": [
                "public",
                "authenticated",
                "internal"
              ]
            },
            "collectionId": {
              "$ref": "#/$defs/__schema0"
            }
          },
          "required": [
            "view"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "view": {
              "type": "string",
              "const": "article"
            },
            "articleId": {
              "type": "string",
              "pattern": "^help_article_[0-7][0123456789abcdefghjkmnpqrstvwxyz]{25}$"
            }
          },
          "required": [
            "view",
            "articleId"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "view": {
              "type": "string",
              "const": "order"
            },
            "collectionId": {
              "$ref": "#/$defs/__schema0"
            }
          },
          "required": [
            "view",
            "collectionId"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "view": {
              "type": "string",
              "const": "imports"
            },
            "after": {
              "$ref": "#/$defs/__schema1"
            },
            "limit": {
              "default": 20,
              "type": "integer",
              "minimum": 1,
              "maximum": 50
            },
            "origin": {
              "type": "string",
              "enum": [
                "pdf",
                "web"
              ]
            }
          },
          "required": [
            "view"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "view": {
              "type": "string",
              "const": "import"
            },
            "documentId": {
              "$ref": "#/$defs/__schema1"
            }
          },
          "required": [
            "view",
            "documentId"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "view": {
              "type": "string",
              "const": "extraction_capabilities"
            }
          },
          "required": [
            "view"
          ],
          "additionalProperties": false
        }
      ]
    },
    "contentCursor": {
      "type": "object",
      "properties": {
        "checksum": {
          "type": "string",
          "pattern": "^[a-f0-9]{64}$"
        },
        "offset": {
          "type": "integer",
          "exclusiveMinimum": 0,
          "maximum": 20000000
        }
      },
      "required": [
        "checksum",
        "offset"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "productId",
    "request"
  ],
  "additionalProperties": false,
  "$defs": {
    "__schema0": {
      "type": "string",
      "pattern": "^help_collection_[0-7][0123456789abcdefghjkmnpqrstvwxyz]{25}$"
    },
    "__schema1": {
      "type": "string",
      "pattern": "^knowledge_document_[0-7][0123456789abcdefghjkmnpqrstvwxyz]{25}$"
    }
  }
}
JSON
Schéma complet de la réponse
JSON
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "format": {
      "type": "string",
      "const": "json"
    },
    "content": {
      "type": "string",
      "maxLength": 12000
    },
    "nextCursor": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "checksum": {
              "type": "string",
              "pattern": "^[a-f0-9]{64}$"
            },
            "offset": {
              "type": "integer",
              "exclusiveMinimum": 0,
              "maximum": 20000000
            }
          },
          "required": [
            "checksum",
            "offset"
          ],
          "additionalProperties": false
        },
        {
          "type": "null"
        }
      ]
    }
  },
  "required": [
    "format",
    "content",
    "nextCursor"
  ],
  "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 bearer with api:connect and knowledge:inspect. A current real user session and consented product are required; navigation and article inspection follow native member access, while order/imports/capabilities require a native administrator; API keys, MCP tokens and browser cookies are refused. Requires public API entitlement and one admitted product API request; mutations preserve billing write locks. Body limit 2 MiB; response limit 128 KiB. Inspection uses native member or administrator authority for the selected view. Select navigation, articles, article variants/revisions, order, imports or extraction capabilities with request.view. Result is stable JSON in 12000 UTF-16-unit chunks. Concatenate content until nextCursor is null; keep request unchanged and pass contentCursor. Parse the assembled JSON and follow its own list cursor for subsequent result pages. Changed content invalidates continuation. Author identities, private object keys and raw service metadata are excluded."
}
JSON