Пример запроса:
curl -X 'POST' \
'https://server.company.com/xapi/push/event' \
-H 'accept: application/json' \
-H 'X-API-Auth-Token: 198igrnlnuonix672uq9' \
-H 'X-API-CompanyId: Yandex' \
-H 'X-API-Version: 1.8' \
-H 'Content-Type: multipart/form-data' \
-H 'X-Enable-OpenAPI: 1' \
-F 'event=
{
"evt_class": 3,
"evt_service": "web_common",
"evt_attributes": [
{ "name": "event_name", "value": "Web Event Name" },
{ "name": "capture_ts", "value": "2024-03-25T23:41:21+03:00" },
{ "name": "capture_server_ip", "value": "127.0.0.1" },
{ "name": "capture_server_fqdn", "value": "captureservername.domain" }
],
"evt_senders": [
{
"identity_id": 3,
"identity_type": 0,
"identity_contacts": [],
"identity_contacts_with_meta": [
{
"contact": { "name": "auth", "value": "userlogin@domain" }
}
]
},
{
"identity_id": 4,
"identity_type": 1,
"identity_contacts": [],
"identity_attributes": [
{ "name": "workstation_type", "value": "ws_type_computer" }
],
"identity_contacts_with_meta": [
{
"contact": { "name": "dnshostname", "value": "computername.domain" }
}
]
}
],
"evt_receivers": [
{
"identity_id": 2,
"identity_type": 3,
"identity_contacts": [],
"identity_attributes": [
{ "name": "res_destination_host", "value": "testhost.com" },
{ "name": "res_destination_url", "value": "\/file\/test.php" }
]
}
],
"evt_data": [
{
"data_id": 1
}
]
} |
Пример запроса для файла с multipart (example):
curl -X 'POST' \
'https://109.73.44.69/xapi/push/event' \
-H 'accept: application/json' \
-H 'X-API-Auth-Token: 198igrnlnuonix672uq9' \
-H 'X-API-CompanyId: Yandex' \
-H 'X-API-Version: 1.8' \
-H 'Content-Type: multipart/form-data' \
-H 'X-Enable-OpenAPI: 1' \
-F 'event={
"evt_class": 4,
"evt_service": "cloud_storage",
"evt_attributes": [
{
"name": "capture_ts",
"value": "2024-02-06T13:40:00+03:00"
},
{
"name": "capture_server_ip",
"value": "127.0.0.1"
},
{
"name": "capture_server_fqdn",
"value": "localhost"
}
],
"evt_senders": [
{
"identity_id": 1,
"identity_type": 0,
"identity_contacts": [
{
"name": "auth",
"value": "user_name@iw"
}
]
},
{
"identity_id": 2,
"identity_type": 1,
"identity_contacts": [
{
"name": "dnshostname",
"value": "localhost.computer.domain"
}
]
}
],
"evt_receivers": [
{
"identity_id": 3,
"identity_type": 3,
"identity_contacts": null
}
],
"evt_data": [
{
"data_id": example,
"data_attributes": [
{
"name": "filename",
"value": "res.txt"
},
{
"name": "destination_file_path",
"value": "goodledrive.com/user/folder/"
}
]
}
],
"evt_destination": {
"identity_id": 4,
"identity_type": 3,
"identity_contacts": null,
"identity_attributes": [
{
"name": "name",
"value": "googledrive.com"
}
]
}
}
' \
-F 'files[]=@example'_ |
Значение 3 поля evt_class соответствует константе
|