POST · Préparer avec OAuth

Tickets : Préparer avec OAuth. Paramètres, accès et exemples de réponse.

Rédigé par Red Blue

Mis à jour le

Tickets

POST /api/v1/tickets/delegated/preparations

operationId : tickets_delegated_prepare

Accès

Permission

Consentements OAuth

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

support.write

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

Champs du corps JSON

Nom

Emplacement

Requis

Type et contraintes

productId

JSON

Oui

string

request

JSON

Oui

object

Exemple de requête

Shell
curl --request POST "$KHONY_ORIGIN/api/v1/tickets/delegated/preparations" \
  --header "Authorization: Bearer $KHONY_ACCESS_TOKEN" \
  --header 'Content-Type: application/json' \
  --data-raw '{
  "productId": "product_01k3w8d7vhe008000000000001",
  "request": {
    "conversationId": "support_conversation_01k3w8d7vhe008000000000003",
    "typeId": "ticket_type_01k3w8d7vhe008000000000004",
    "locale": "fr"
  }
}'
Shell

Réponse de succès · HTTP 200

JSON
{
  "data": {
    "draft": {
      "title": "Diagnostic de l’import",
      "description": "",
      "answers": {}
    },
    "catalogRevision": 1,
    "contextRevision": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
    "ai": false
  }
}
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": {
        "conversationId": {
          "type": "string",
          "pattern": "^support_conversation_[0-7][0123456789abcdefghjkmnpqrstvwxyz]{25}$"
        },
        "typeId": {
          "type": "string",
          "pattern": "^ticket_type_[0-7][0123456789abcdefghjkmnpqrstvwxyz]{25}$"
        },
        "locale": {
          "type": "string",
          "enum": [
            "fr",
            "en"
          ]
        }
      },
      "required": [
        "conversationId",
        "typeId",
        "locale"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "productId",
    "request"
  ],
  "additionalProperties": false
}
JSON
Schéma complet de la réponse
JSON
{
  "$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"
          }
        }
      ]
    }
  }
}
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 support:write. Uses the same native AI prefill, actual teammate context, product budget, provider accounting and post-provider revalidation as tickets_prepare. No replay guarantee; repeating may incur another charge. A proposal is not an accepted ticket."
}
JSON