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

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

Ключ

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

Предполагается, что сначала создаётся создается эталонный документ, с помощью помощью POST /xapi/etalonDocument со статусом new, а дальше происходит его компиляция, статус которой нужно проверять с помощью получения эталонного документа (GET /xapi/etalonDocument/{id}) и его отслеживания. При получении дубликатов эталонного документа (STATUS=duplicate), такие файлы будут удалены.

Метод: POST
Ресурс: etalonDocument

Поля запрсазапроса:

Название поля
Описание

DISPLAY_NAME

Имя эталонного документа (если не указано, то берётся берется из поля FILE)
FILE_PATH*

Путь к эталонному документу в источнике, например:

  • smb://example.com/top_secret/etalon.docx,
  • \\example\test\text.rtf,
  • ftp://example.com/foo/bar.txt,
  • oracle://example.com:1521/database/table/row, 
  • https://examlpeexample.com/same/html/document

По факту, это просто подсказка для автоматического загрузчика, по которой он может искатьданному полю автоматический загрузчик производит поиск

NOTE

Описание эталонного документа

BIN_VALUE_THRESHOLDПорог цитируемости бинарных данных (по умолчанию берется из первого указанного каталога)
TEXT_VALUE_THRESHOLDПорог цитируемости текстовых данных (по умолчанию берется из первого указанного каталога)
CATEGORY_ID*Список GUID-ов категорий, разделенных запятой, например: "E77D893219A24EEAB3D049804FD86751,C743F88121B8449DAF37291474830679,A7AF8EFCF4D54E9393A9B3D750E5ABBB"
FILE*Сам файл (передаётся передается сам файл, а не путь к нему. Сервер не сможет подключиться к вашему компьютеру и забрать его сам. Поэтому весь файл передаётся передается в запросе)
COMPILE_TYPE*

Тип цифрового отпечатка:

  • TEXT – извлекать только текст
  • ALL – извлекать и компилировать всёвсе, что возможно

* – поле обязательно для заполнения

Блок кода
languagetext
titleJSON-Schema ответа:
collapsetrue
{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "definitions": {},
    "id": "http://infowatch.com/tm/etalonDocument",
    "type": "object",
    "properties": {
        "FINGERPRINT_ID": {
            "examples": [
                "139C7026ED48BE13459669024786F7517E5687AE"
            ],
            "title": "Идентификатор эталонного документа",
            "type": "string"
        },
        "DISPLAY_NAME": {
            "title": "Название",
            "type": "string"
        },
        "FILE_PATH": {
            "title": "Полное имя файла",
            "type": "string"
        },
        "FILE_SIZE": {
            "title": "Размер файла в байтах",
            "type": "integer"
        },
        "MIME": {
            "title": "Mime-type файла",
            "type": "string"
        },
        "BIN_VALUE_THRESHOLD": {
            "title": "Порог цитируемости бинарных данных",
            "type": "integer"
        },
        "TEXT_VALUE_THRESHOLD": {
            "title": "Порог цитируемости текстовых данных",
            "type": "integer"
        },
        "NOTE": {
            "title": "Описание",
            "type": [
                "null",
                "string"
            ]
        },
        "OWNER": {
            "title": "ID токена",
            "type": "integer"
        },
        "STATUS": {
            "examples": [
                "new",
                "compiled",
                "compiling",
                "sending",
                "sent",
                "saving",
                "ready",
                "fatal_error",
                "duplicate",
                "error"
            ],
            "title": "Статус обработки",
            "type": "string"
        },
        "CREATE_DATE": {
            "examples": [
                "2017-07-04 10:45:45.000000"
            ],
            "title": "Дата создания",
            "type": "string"
        },
        "CHANGE_DATE": {
            "examples": [
                "2017-07-04 10:45:45.000000"
            ],
            "title": "Дата изменения",
            "type": "string"
        },
        "categories": {
            "type": "array",
            "title": "Массив категорий",
            "items": {
                "type": "object",
                "properties": {
                    "CATEGORY_ID": {
                        "examples": [
                            "AC3DF073B60107890A4C704A10577FE700000000"
                        ],
                        "title": "GUID категории",
                        "type": "string"
                    },
                    "DISPLAY_NAME": {
                        "title": "Название",
                        "type": "string"
                    },
                    "DIR_PATH (возможно изменение в названии)": {
                        "title": "Полное имя директории",
                        "type": "string"
                    },
                    "FP_BIN_VALUE_THRESHOLD": {
                        "title": "Порог цитируемости бинарных данных",
                        "type": "integer"
                    },
                    "FP_TEXT_VALUE_THRESHOLD": {
                        "title": "Порог цитируемости текстовых данных",
                        "type": "integer"
                    },
                    "NOTE": {
                        "title": "Описание",
                        "type": [
                            "null",
                            "string"
                        ]
                    },
                    "OWNER": {
                        "title": "ID токена",
                        "type": "integer"
                    },
                    "CREATE_DATE": {
                        "examples": [
                            "2017-07-04 10:45:45.000000"
                        ],
                        "title": "Дата создания",
                        "type": "string"
                    },
                    "CHANGE_DATE": {
                        "examples": [
                            "2017-07-04 10:45:45.000000"
                        ],
                        "title": "Дата изменения",
                        "type": "string"
                    }
                }
            }
        }
    }
}
Блок кода
languagetext
titleПример запроса:
collapsetrue
POST /xapi/etalonDocument HTTP/1.1
Host: tm.example.com
X-API-Auth-Token: brse99dugp1cdbr69axz
X-API-Version: 1
X-API-DataType: cap
X-API-CompanyId: liw
Content-Type: multipart/form-data; boundary=Asrf456BGe4h
Content-Length: (суммарный объём, включая дочерние заголовки)
(пустая строка)
(отсутствующая преамбула)
--Asrf456BGe4h
Content-Disposition: form-data; name="CATEGORY_ID"
(пустая строка)
2ABECC84F2360B94E0533D003C0A80AE00000000
--Asrf456BGe4h
Content-Disposition: form-data; name="COMPILE_TYPE"
(пустая строка)
ALL
--Asrf456BGe4h
Content-Disposition: form-data; name="FILE"; filename="foo.doc"
Content-Type: application/msword
(пустая строка)
(двоичное содержимое документа)
Блок кода
languagetext
titleПример создания файла с помощью CURL :CURL
collapsetrue
curl -i -X POST \
   -H "Content-Type:multipart/form-data" \
   -H "X-API-Auth-Token:brse99dugp1cdbr69axz" \
   -H "X-API-Version:1" \
   -H "X-API-DataType:cap" \
   -H "X-API-CompanyId:liw" \
   -F "CATEGORY_ID=2ABECC84F2360B94E0533D003C0A80AE00000000" \
   -F "FILE=@\"./foo.doc\";filename=\"foo.doc\"" \
   -F "COMPILE_TYPE=ALL" \
 'https://tm.example.com/xapi/etalonDocument'
Sv translation
languageen

It is considered that initially the sample document is created by means of POST /xapi/etalonDocument with status "new". Then sample document's compilation is done, its status should be checked when getting this document document (GET /xapi/etalonDocument/{id}) and monitoring it. The sample document's duplicates (STATUS=duplicate) will be deleted, if received.  

Method: POST
Resource: etalonDocument
Request body:

Fields:

Field name
Description

DISPLAY_NAME

Sample document name (if not specified, to be taken from FILE field)
FILE_PATH*

Path to sample document in source, e.g.:

 smb

  • smb://example.com/top_secret/etalon.docx
,
  • ;
  • \\example\test\text.rtf,
 ftp
, oracle
  • ;
  • oracle://example.com:1521/database/table/row
, 
  • ;
  • https://examlpe.com/same/html/document
In fact, this is a tip for automatic loader to be used for search.
  • .

This field is used by automatic loader for searching

NOTE

Sample document description.

BIN_VALUE_THRESHOLDBinary data quote index (by default, to be taken from the first catalog specified).
TEXT_VALUE_THRESHOLDText data quote index (by default, to be taken from the first catalog specified).
CATEGORY_ID*List of GUID categories, separated by comma, e.g.: "E77D893219A24EEAB3D049804FD86751,C743F88121B8449DAF37291474830679,A7AF8EFCF4D54E9393A9B3D750E5ABBB"
FILE*File itself (The file is sent, not the path to a file. Server cannot connect to your PC and take the file. Thus, the file is sent via request).
COMPILE_TYPE*

Type of digital fingerprint:

  • TEXT — to extract text only
  • ALL — to extract and compile all types of data

* — field is obligatory

Блок кода
languagetext
titleResponse: JSON-Schema
:
collapse
 
true
{

    "$schema": "http://json-schema.org/draft-04/schema#",

    "definitions": {},

    "id": "http://infowatch.com/tm/etalonDocument",

    "type": "object",

    "properties": {

        "FINGERPRINT_ID": {

            "examples": [

                "139C7026ED48BE13459669024786F7517E5687AE"

            ],

            "title": "sample document identifier",

            "type": "string"

        },

        "DISPLAY_NAME": {

            "title": "Title",

            "type": "string"

        },

        "FILE_PATH": {

            "title": "File full name",

            "type": "string"

        },

        "FILE_SIZE": {

            "title": "File size in bytes",

            "type": "integer"

        },

        "MIME": {

            "title": "File mime-type",

            "type": "string"

        },

        "BIN_VALUE_THRESHOLD": {

            "title": "Binary data quote index",

            "type": "integer"

        },

        "TEXT_VALUE_THRESHOLD": {

            "title": "Text data quote index",

            "type": "integer"

        },

        "NOTE": {

            "title": "Description",

            "type": [

                "null",

                "string"

            ]

        },

        "OWNER": {

            "title": "Token ID",

            "type": "integer"

        },

        "STATUS": {

            "examples": [

                "new",

                "compiled",

                "compiling",

                "sending",

                "sent",

                "saving",

                "ready",

                "fatal_error",

                "duplicate",

                "error"

            ],

            "title": "Status of processing",

            "type": "string"

        },

        "CREATE_DATE": {

            "examples": [

                "2017-07-04 10:45:45.000000"

            ],

            "title": "Date of creation",

            "type": "string"

        },

        "CHANGE_DATE": {

            "examples": [

                "2017-07-04 10:45:45.000000"

            ],

            "title": "Date of change",

            "type": "string"

        },

        "categories": {

            "type": "array",

            "title": "Массив категорий",

            "items": {

                "type": "object",

                "properties": {

                    "CATEGORY_ID": {

                        "examples": [

                            "AC3DF073B60107890A4C704A10577FE700000000"

                        ],

                        "title": "GUID categories",

                        "type": "string"

                    },

                    "DISPLAY_NAME": {

                        "title": "Title",

                        "type": "string"

                    },

                    "DIR_PATH (title can be changed)": {

                        "title": "Directory full name",

                        "type": "string"

                    },

                    "FP_BIN_VALUE_THRESHOLD": {

                        "title": "Binary data quote index",

                        "type": "integer"

                    },

                    "FP_TEXT_VALUE_THRESHOLD": {

                        "title": "Text data quote index",

                        "type": "integer"

                    },

                    "NOTE": {

                        "title": "Description",

                        "type": [

                            "null",

                            "string"

                        ]

                    },

                    "OWNER": {

                        "title": "Token ID",

                        "type": "integer"

                    },

                    "CREATE_DATE": {

                        "examples": [

                            "2017-07-04 10:45:45.000000"

                        ],

                        "title": "Date of creation",

                        "type": "string"

                    },

                    "CHANGE_DATE": {

                        "examples": [

                            "2017-07-04 10:45:45.000000"

                        ],

                        "title": "Date of change",

                        "type": "string"

                    }

                }

            }

        }

    }
}

 

Example:

 

POST

}
Блок кода
languagetext
titleExample
collapsetrue
POST /xapi/etalonDocument HTTP/1.1

Host:
 tm
 tm.example.com

X-API-Auth-Token: brse99dugp1cdbr69axz

X-API-Version:
 1
 1
X-API-DataType: cap

X-API-CompanyId: liw

Content-Type: multipart/form-data; boundary=Asrf456BGe4h

Content-Length: (total amount, including subheaders)

(empty line)

(absent preamble)

--Asrf456BGe4h

Content-Disposition: form-data; name="CATEGORY_ID"

(empty line)

2ABECC84F2360B94E0533D003C0A80AE00000000

--Asrf456BGe4h

Content-Disposition: form-data; name="COMPILE_TYPE"

(empty line)

ALL

--Asrf456BGe4h

Content-Disposition: form-data; name="FILE"; filename="foo.doc"

Content-Type: application/msword

(empty line)

(binary content of document )
 
Блок кода
languagetext
titleExample of creating the file by means of CURL
 
collapse
 
true
curl -i -X POST \

   -H "Content-Type:multipart/form-data" \

   -H "X-API-Auth-Token:brse99dugp1cdbr69axz" \

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

   -H "X-API-DataType:cap" \

   -H "X-API-CompanyId:liw" \

   -F "CATEGORY_ID=2ABECC84F2360B94E0533D003C0A80AE00000000" \

   -F "FILE=@\"./foo.doc\";filename=\"foo.doc\"" \

   -F "COMPILE_TYPE=ALL" \

 'https://tm.example.com/xapi/etalonDocument'