Aller au contenu principal

Configurer les incidents ServiceNow

POST /api/auth/servicenow/tasks

Origine canonique uniquement. POST nécessite un en-tête Origin exact et application/json. Les sessions navigateur utilisent un cookie HttpOnly, Secure, SameSite=Strict. Les sessions d'installation ne peuvent pas accéder aux API des locataires. Le provisionnement des locataires et l'audit global nécessitent un opérateur de plateforme ; l'administration des membres nécessite un administrateur du locataire. SSO est reporté. Session navigateur vérifiée d'administrateur d'espace et connexion configurée avec propriétaire d'autorisation actuel requises. Lit/enregistre les valeurs par défaut d'incident, parcourt les tâches de migration (50 par page), prépare un aperçu dérivé du serveur ou revalide un aperçu. La sauvegarde avance la révision de connexion et efface les aperçus antérieurs. Les champs sources sont explicitement autorisés ; preuves brutes, champs privés du scanner et contenu de tâche fourni par l'appelant sont exclus. Les aperçus expirent après cinq minutes, lient acteur, tâche/preuve, mappage, révision et génération d'identifiant, et exposent un hachage exact et un ID de requête serveur. Un titre de plus de 160 caractères nécessite un titre de tâche plus court ou un résumé fixe. Les ID de référence et règles propres à l'instance restent non validés. list-choices effectue une lecture bornée des choix anglais de catégorie/sous-catégorie incident depuis sys_choice (100 par page, curseur sys_id). Nécessite l'accès facultatif en lecture à la table de choix, revérifie autorisation de connexion et génération d'identifiant, et n'établit pas l'accès en écriture ni la validité des règles métier. Les autres opérations de configuration n'appellent pas le fournisseur. Aucun incident n'est créé.

Authentification​

Les alternatives OpenAPI suivantes décrivent les méthodes d'authentification acceptées. Les modifications depuis le navigateur nécessitent également l'en-tête Origin canonique.

[
{
"browserSession": []
}
]

Paramètres​

[]

Corps de la requête​

{
"required": true,
"content": {
"application/json": {
"schema": {
"oneOf": [
{
"type": "object",
"properties": {
"operation": {
"type": "string",
"const": "list-choices"
},
"connectionId": {
"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)$"
},
"expectedRevision": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
},
"after": {
"type": "string",
"pattern": "^[a-f0-9]{32}$"
}
},
"required": [
"operation",
"connectionId",
"expectedRevision"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"operation": {
"type": "string",
"const": "list-tasks"
},
"connectionId": {
"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)$"
},
"expectedRevision": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
},
"after": {
"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": [
"operation",
"connectionId",
"expectedRevision"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"operation": {
"type": "string",
"const": "read-mapping"
},
"connectionId": {
"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)$"
},
"expectedRevision": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
}
},
"required": [
"operation",
"connectionId",
"expectedRevision"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"operation": {
"type": "string",
"const": "save-mapping"
},
"connectionId": {
"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)$"
},
"expectedRevision": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
},
"mapping": {
"type": "object",
"properties": {
"shortDescription": {
"oneOf": [
{
"type": "object",
"properties": {
"source": {
"type": "string",
"const": "task-title"
}
},
"required": [
"source"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"source": {
"type": "string",
"const": "constant"
},
"value": {
"type": "string",
"minLength": 1,
"maxLength": 160
}
},
"required": [
"source",
"value"
],
"additionalProperties": false
}
]
},
"includeTaskDetails": {
"type": "boolean"
},
"defaults": {
"type": "object",
"properties": {
"urgency": {
"type": "string",
"enum": [
"1",
"2",
"3"
]
},
"impact": {
"type": "string",
"enum": [
"1",
"2",
"3"
]
},
"assignment_group": {
"type": "string",
"pattern": "^[0-9a-f]{32}$"
},
"assigned_to": {
"type": "string",
"pattern": "^[0-9a-f]{32}$"
},
"cmdb_ci": {
"type": "string",
"pattern": "^[0-9a-f]{32}$"
},
"category": {
"type": "string",
"minLength": 1,
"maxLength": 80
},
"subcategory": {
"type": "string",
"minLength": 1,
"maxLength": 80
},
"customFields": {
"type": "object",
"propertyNames": {
"type": "string",
"pattern": "^(?:u_|x_)[a-z][a-z0-9_]{0,77}$"
},
"additionalProperties": {
"anyOf": [
{
"type": "string",
"maxLength": 1024
},
{
"type": "boolean"
},
{
"type": "number"
}
]
}
}
},
"additionalProperties": false
}
},
"required": [
"shortDescription",
"includeTaskDetails",
"defaults"
],
"additionalProperties": false
}
},
"required": [
"operation",
"connectionId",
"expectedRevision",
"mapping"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"operation": {
"type": "string",
"const": "prepare-task"
},
"connectionId": {
"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)$"
},
"expectedRevision": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
},
"planId": {
"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)$"
},
"expectedPlanVersion": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
}
},
"required": [
"operation",
"connectionId",
"expectedRevision",
"planId",
"expectedPlanVersion"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"operation": {
"type": "string",
"const": "read-preview"
},
"connectionId": {
"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)$"
},
"expectedRevision": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
},
"previewId": {
"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": [
"operation",
"connectionId",
"expectedRevision",
"previewId"
],
"additionalProperties": false
}
]
}
}
}
}

Réponses​

{
"200": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"anyOf": [
{
"type": "object",
"properties": {
"items": {
"maxItems": 100,
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "^[a-f0-9]{32}$"
},
"field": {
"type": "string",
"enum": [
"category",
"subcategory"
]
},
"value": {
"type": "string",
"minLength": 1,
"maxLength": 80
},
"label": {
"type": "string",
"minLength": 1,
"maxLength": 256
},
"dependentValue": {
"type": "string",
"maxLength": 80
}
},
"required": [
"id",
"field",
"value",
"label",
"dependentValue"
],
"additionalProperties": false
}
},
"nextAfter": {
"anyOf": [
{
"type": "string",
"pattern": "^[a-f0-9]{32}$"
},
{
"type": "null"
}
]
},
"language": {
"type": "string",
"const": "en"
},
"table": {
"type": "string",
"const": "incident"
}
},
"required": [
"items",
"nextAfter",
"language",
"table"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"configured": {
"type": "boolean"
},
"mapping": {
"type": "object",
"properties": {
"shortDescription": {
"oneOf": [
{
"type": "object",
"properties": {
"source": {
"type": "string",
"const": "task-title"
}
},
"required": [
"source"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"source": {
"type": "string",
"const": "constant"
},
"value": {
"type": "string",
"minLength": 1,
"maxLength": 160
}
},
"required": [
"source",
"value"
],
"additionalProperties": false
}
]
},
"includeTaskDetails": {
"type": "boolean"
},
"defaults": {
"type": "object",
"properties": {
"urgency": {
"type": "string",
"enum": [
"1",
"2",
"3"
]
},
"impact": {
"type": "string",
"enum": [
"1",
"2",
"3"
]
},
"assignment_group": {
"type": "string",
"pattern": "^[0-9a-f]{32}$"
},
"assigned_to": {
"type": "string",
"pattern": "^[0-9a-f]{32}$"
},
"cmdb_ci": {
"type": "string",
"pattern": "^[0-9a-f]{32}$"
},
"category": {
"type": "string",
"minLength": 1,
"maxLength": 80
},
"subcategory": {
"type": "string",
"minLength": 1,
"maxLength": 80
},
"customFields": {
"type": "object",
"propertyNames": {
"type": "string",
"pattern": "^(?:u_|x_)[a-z][a-z0-9_]{0,77}$"
},
"additionalProperties": {
"anyOf": [
{
"type": "string",
"maxLength": 1024
},
{
"type": "boolean"
},
{
"type": "number"
}
]
}
}
},
"additionalProperties": false
}
},
"required": [
"shortDescription",
"includeTaskDetails",
"defaults"
],
"additionalProperties": false
},
"revision": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
}
},
"required": [
"configured",
"mapping",
"revision"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"items": {
"maxItems": 50,
"type": "array",
"items": {
"type": "object",
"properties": {
"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)$"
},
"version": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
},
"title": {
"type": "string",
"maxLength": 200
}
},
"required": [
"id",
"version",
"title"
],
"additionalProperties": false
}
},
"nextCursor": {
"anyOf": [
{
"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)$"
},
{
"type": "null"
}
]
}
},
"required": [
"items",
"nextCursor"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"previewId": {
"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)$"
},
"planId": {
"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)$"
},
"planVersion": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
},
"requestId": {
"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)$"
},
"fields": {
"type": "object",
"properties": {
"short_description": {
"type": "string",
"minLength": 1,
"maxLength": 160
},
"description": {
"type": "string",
"maxLength": 20000
},
"urgency": {
"type": "string",
"enum": [
"1",
"2",
"3"
]
},
"impact": {
"type": "string",
"enum": [
"1",
"2",
"3"
]
},
"assignment_group": {
"type": "string",
"pattern": "^[0-9a-f]{32}$"
},
"assigned_to": {
"type": "string",
"pattern": "^[0-9a-f]{32}$"
},
"cmdb_ci": {
"type": "string",
"pattern": "^[0-9a-f]{32}$"
},
"category": {
"type": "string",
"minLength": 1,
"maxLength": 80
},
"subcategory": {
"type": "string",
"minLength": 1,
"maxLength": 80
},
"customFields": {
"type": "object",
"propertyNames": {
"type": "string",
"pattern": "^(?:u_|x_)[a-z][a-z0-9_]{0,77}$"
},
"additionalProperties": {
"anyOf": [
{
"type": "string",
"maxLength": 1024
},
{
"type": "boolean"
},
{
"type": "number"
}
]
}
}
},
"required": [
"short_description"
],
"additionalProperties": false
},
"payloadHash": {
"type": "string",
"pattern": "^[a-f0-9]{64}$"
},
"createdAt": {
"type": "string",
"format": "date-time",
"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])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
},
"expiresAt": {
"type": "string",
"format": "date-time",
"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])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
},
"unverifiedReferences": {
"type": "array",
"items": {
"type": "string",
"enum": [
"assignment_group",
"assigned_to",
"cmdb_ci"
]
}
},
"providerValidation": {
"type": "string",
"const": "not-performed"
},
"incidentCreated": {
"type": "boolean",
"const": false
}
},
"required": [
"previewId",
"planId",
"planVersion",
"requestId",
"fields",
"payloadHash",
"createdAt",
"expiresAt",
"unverifiedReferences",
"providerValidation",
"incidentCreated"
],
"additionalProperties": false
}
]
}
}
}
},
"400": {
"description": "Validation error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"401": {
"description": "Missing/expired/revoked credential",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"403": {
"description": "Insufficient role",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"404": {
"description": "Not found",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"409": {
"description": "State or idempotency conflict",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"413": {
"description": "Body too large",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"415": {
"description": "Unsupported media type",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"429": {
"description": "Request budget exhausted; respect Retry-After",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
},
"headers": {
"Retry-After": {
"schema": {
"type": "integer",
"minimum": 1
},
"description": "Seconds until sufficient budget is expected; concurrent traffic may consume replenished capacity."
}
}
},
"500": {
"description": "Internal error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"503": {
"description": "Not configured",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
}
}

Les références telles que #/components/schemas/Asset sont résolues dans les schémas partagés. Téléchargez le contrat OpenAPI pour générer des clients. Cette page est générée ; elle décrit l'API de développement implémentée, et non des points de terminaison prévus.