Пример запроса на отправку одного файла:
curl -X 'POST' \
'https://server.company.ru/xapi/push/event' \
-H 'accept: application/json' \
-H 'X-API-Auth-Token: brse99dugp1cdbr69axz' \
-H 'X-API-CompanyId: IW' \
-H 'X-API-Version: 1' \
-H 'Content-Type: multipart/form-data' \
-H 'X-Enable-OpenAPI: 1' \
-F 'event={
"evt_class": 4,
"evt_service": "ftp",
"evt_attributes": [
{
"name": "event_name",
"value": "FTP Event"
},
{
"name": "capture_ts",
"value": "2025-05-27T15:49:56+03:00"
},
{
"name": "capture_server_ip",
"value": "127.0.0.1"
},
{
"name": "capture_server_fqdn",
"value": "localhost"
}
],
"evt_senders": [
{
"identity_id": 3,
"identity_type": 0,
"identity_contacts": [
{
"name": "login",
"value": "villain"
}
]
},
{
"identity_id": 4,
"identity_type": 1,
"identity_contacts": [
{
"name": "dnshostname",
"value": "localhost.computer.domain"
}
],
"identity_attributes": [
{
"name": "workstation_type",
"value": "ws_type_computer"
}
]
}
],
"evt_receivers": [
{
"identity_id": 2,
"identity_type": 3,
"identity_contacts": [],
"identity_attributes": [
{
"name": "res_destination_host",
"value": "ftp.site.org"
},
{
"name": "res_destination_url",
"value": "catalog\\catalog\\res.file"
}
]
}
],
"evt_data": [
{
"data_id": 1,
"data_attributes": [
{
"name": "filename",
"value": "/root/test.png"
},
{
"name": "destination_file_path",
"value": "Send file here"
}
]
}
]
}' \
-F 'files[]=@/root/test.png;filename=1'
Пример запроса на отправку нескольких файлов:
curl -X 'POST' \
'https://server.company.ru/xapi/push/event' \
-H 'accept: application/json' \
-H 'X-API-Auth-Token: brse99dugp1cdbr69axz' \
-H 'X-API-CompanyId: IW' \
-H 'X-API-Version: 1' \
-H 'Content-Type: multipart/form-data' \
-H 'X-Enable-OpenAPI: 1' \
-F 'event={
"evt_class": 4,
"evt_service": "ftp",
"evt_attributes": [
{
"name": "event_name",
"value": "FTP Event"
},
{
"name": "capture_ts",
"value": "2025-06-03T16:03:10+03:00"
},
{
"name": "capture_server_ip",
"value": "127.0.0.1"
},
{
"name": "capture_server_fqdn",
"value": "localhost"
}
],
"evt_senders": [
{
"identity_id": 3,
"identity_type": 0,
"identity_contacts": [
{
"name": "login",
"value": "villain"
}
]
},
{
"identity_id": 4,
"identity_type": 1,
"identity_contacts": [
{
"name": "dnshostname",
"value": "localhost.computer.domain"
}
],
"identity_attributes": [
{
"name": "workstation_type",
"value": "ws_type_computer"
}
]
}
],
"evt_receivers": [
{
"identity_id": 2,
"identity_type": 3,
"identity_contacts": [],
"identity_attributes": [
{
"name": "res_destination_host",
"value": "ftp.site.org"
},
{
"name": "res_destination_url",
"value": "catalog\\catalog\\res.file"
}
]
}
],
"evt_data": [
{
"data_id": 0,
"data_attributes": [
{
"name": "filename",
"value": "/root/test.png"
},
{
"name": "destination_file_path",
"value": "Send file here"
}
]
},
{
"data_id": 1,
"data_attributes": [
{
"name": "filename",
"value": "/root/test1.png"
},
{
"name": "destination_file_path",
"value": "Send file here"
}
]
}
]
}' \
-F 'files[]=@/root/test.png;filename=0' \
-F 'files[]=@/root/test1.png;filename=1'
Примечание:
В узле -F значение переменной filename соответствует значению поля data_id.