Дерево страниц

Сравнение версий

Ключ

  • Эта строка добавлена.
  • Эта строка удалена.
  • Изменено форматирование.
Комментарий: Published by Scroll Versions from space TMAG and version 7.13
Sv translation
languageru

Версия API: ≥ 1.2

Метод: PATCH

Ресурс: event/userDecision

Описание:

Метод позволяет массово назначать решения пользователя (принимает не более 1000 решений пользователя, иначе возвращается сообщение об ошибке с кодом 413). ID события и ID табличного пространства передаются в передаются в теле запроса с решением пользователя и комментарием.

 code
Блок кода
language
text
titleТело запроса: JSON схема для множественного назначения вердиктов
collapsetrue
{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "type": "array",
  "title": "Set batch user decision schema",
  "items": {
    "$id": "#/items",
    "type": "object",
    "required": [
      "OBJECT_ID",
      "TBS_ID",
      "USER_DECISION"
    ],
    "properties": {
      "OBJECT_ID": {
        "$id": "#/items/properties/OBJECT_ID",
        "type": "integer",
        "title": "ID События"
      },
      "TBS_ID": {
        "$id": "#/items/properties/TBS_ID",
        "type": "integer",
        "title": "ID табличного пространства"
      },
      "USER_DECISION": {
        "$id": "#/items/properties/USER_DECISION",
        "type": "string",
        "title": "User decision",
        "enum": [
          "NotProcessed",
          "Violation",
          "NoViolation",
          "AdditionalProcessingNeeded"
        ]
      },
      "NOTE": {
        "$id": "#/items/properties/NOTE",
        "type": "string",
        "title": "Note",
        "maxLength": 1000
      }
    }
  }
}
 
Блок кода
 
language
code
text
titleТело ответа: JSON схема для множественного назначения вердиктов
collapsetrue
 {
  "$schema": "http://json-schema.org/draft-07/schema#",
  "type": "array",
  "title": "Array result",
  "items": {
    "$id": "#/items",
    "type": "object",
    "title": "Result setting user decision schema",
    "required": [
      "OBJECT_ID",
      "TBS_ID",
      "VERDICT",
      "USER_DECISION",
      "FORWARD_STATE_CODE"
    ],
    "properties": {
      "OBJECT_ID": {
        "$id": "#/items/properties/OBJECT_ID",
        "type": "integer",
        "title": "ID События"
      },
      "TBS_ID": {
        "$id": "#/items/properties/TBS_ID",
        "type": "integer",
        "title": "ID табличного пространства"
      },
      "VERDICT": {
        "$id": "#/items/properties/VERDICT",
        "type": "string",
        "title": "Вердикт",
        "enum": [
          "Allowed",
          "Quarantined",
          "Forbidden"
        ]
      },
      "USER_DECISION": {
        "$id": "#/items/properties/USER_DECISION",
        "type": "string",
        "title": "Проставленное решение пользователя",
        "enum": [
          "NotProcessed",
          "NoViolation",
          "Violation",
          "AdditionalProcessingNeeded"
        ]
      },
      "FORWARD_STATE_CODE": {
        "$id": "#/items/properties/FORWARD_STATE_CODE",
        "type": "string",
        "title": "Статус отправки",
        "examples": [
          "Sent",
          "NotSent",
          "Pending"
        ]
      }
    }
  }
}
Блок кода
language

Пример: 

 
text
titleПример
collapsetrue
curl 'https://example.com/xapi/event/userDecision' \

  -X PATCH \

  -H 'X-API-Auth-Token: 1792jmclf7fer1ikuhby' \

  -H 'X-API-Version: 1' \

  -H 'X-API-CompanyId: IW' \

  -H 'X-API-ImporterName: dome' \

  -H 'Content-Type: application/json' \

  --data-binary '[{"OBJECT_ID": 1, "TBS_ID": 1, "USER_DECISION":"Violation","NOTE":"Проставление вердикта через Dome. Сотрудник Иванов Виктор Павлович."},{"OBJECT_ID": 24, "TBS_ID": 2, "USER_DECISION":"AdditionalProcessingNeeded"}]'
Sv translation
languageen

API Version: ≥ 1.2

Method: PATCH

Resource: event/userDecision

Description:

The method is used to assign user decision to multiple events (no more than 1000 user decisions, otherwise 413 error message will be returned). Event ID and tablespace ID are sent within the request body containing user decision and comment. 

Блок кода
 code
language
text
titleRequest body: JSON scheme for multiple assignment of verdicts
collapsetrue
{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "type": "array",
  "title": "Set batch user decision schema",
  "items": {
    "$id": "#/items",
    "type": "object",
    "required": [
      "OBJECT_ID",
      "TBS_ID",
      "USER_DECISION"
    ],
    "properties": {
      "OBJECT_ID": {
        "$id": "#/items/properties/OBJECT_ID",
        "type": "integer",
        "title": "Event ID"
      },
      "TBS_ID": {
        "$id": "#/items/properties/TBS_ID",
        "type": "integer",
        "title": "Tablespace ID"
      },
      "USER_DECISION": {
        "$id": "#/items/properties/USER_DECISION",
        "type": "string",
        "title": "User decision",
        "enum": [
          "NotProcessed",
          "Violation",
          "NoViolation",
          "AdditionalProcessingNeeded"
        ]
      },
      "NOTE": {
        "$id": "#/items/properties/NOTE",
        "type": "string",
        "title": "Note",
        "maxLength": 1000
      }
    }
  }
}
 
Блок кода
 
language
code
text
titleResponse body: JSON scheme for multiple assignment of verdicts
collapsetrue
 {
  "$schema": "http://json-schema.org/draft-07/schema#",
  "type": "array",
  "title": "Array result",
  "items": {
    "$id": "#/items",
    "type": "object",
    "title": "Result setting user decision schema",
    "required": [
      "OBJECT_ID",
      "TBS_ID",
      "VERDICT",
      "USER_DECISION",
      "FORWARD_STATE_CODE"
    ],
    "properties": {
      "OBJECT_ID": {
        "$id": "#/items/properties/OBJECT_ID",
        "type": "integer",
        "title": "Event ID"
      },
      "TBS_ID": {
        "$id": "#/items/properties/TBS_ID",
        "type": "integer",
        "title": "Tablespace ID"
      },
      "VERDICT": {
        "$id": "#/items/properties/VERDICT",
        "type": "string",
        "title": "Verdict",
        "enum": [
          "Allowed",
          "Quarantined",
          "Forbidden"
        ]
      },
      "USER_DECISION": {
        "$id": "#/items/properties/USER_DECISION",
        "type": "string",
        "title": "User decision assigned",
        "enum": [
          "NotProcessed",
          "NoViolation",
          "Violation",
          "AdditionalProcessingNeeded"
        ]
      },
      "FORWARD_STATE_CODE": {
        "$id": "#/items/properties/FORWARD_STATE_CODE",
        "type": "string",
        "title": "Sending status",
        "examples": [
          "Sent",
          "NotSent",
          "Pending"
        ]
      }
    }
  }
}
Блок кода
languagetext
titleExample
: 
collapse
 
true
curl 'https://example.com/xapi/event/userDecision' \

  -X PATCH \

  -H 'X-API-Auth-Token: 1792jmclf7fer1ikuhby' \

  -H 'X-API-Version: 1' \

  -H 'X-API-CompanyId: IW' \

  -H 'X-API-ImporterName: dome' \

  -H 'Content-Type: application/json' \

  --data-binary '[{"OBJECT_ID": 1, "TBS_ID": 1, "USER_DECISION":"Violation","NOTE":"Verdict assigning via Dome. Employee John Smith."},{"OBJECT_ID": 24, "TBS_ID": 2, "USER_DECISION":"AdditionalProcessingNeeded"}]'