export_file
To export the results of an item search to an XLSX file, use the core/export_file method.
The method searches for items by the spec criteria in the same way as core/search_items. If core/search_items was called earlier in the same session with the same criteria, the method uses its result instead of searching again, unless force is 1. The file includes all found items, not only one page of results.
Endpoint
svc=core/export_file¶ms={
"spec": {
"itemsType": "<text>",
"propName": "<text>",
"propValueMask": "<text>",
"sortType": "<text>"
},
"force": <uint>,
"flags": <long> /* Column flags. */
}
Parameters
The spec and force parameters are described on the core/search_items page.
The flags parameter defines which columns to include in the file. The available flags depend on the itemsType value.
Users (user)
| Value | Description |
|---|---|
0x0001 |
Name. |
0x0002 |
Creator. |
0x0004 |
Account. |
0x0008 |
Billing plan. |
0x0010 |
Last visit. |
0x0020 |
Email. |
0x0040 |
Host mask. |
0x0080 |
Authentication type. |
0x0100 |
Phone number for two-factor authentication. |
0x0200 |
Status: whether the Enabled option is turned on in the user properties. |
0x0400 |
Permission to change the password. |
0x0800 |
Permission to create items. |
0x1000 |
Permission to change settings. |
0x2000 |
Permission to send SMS. |
0x4000 |
Time zone. |
Units (avl_unit)
| Value | Description |
|---|---|
0x0001 |
Name. |
0x0002 |
Creator. |
0x0004 |
Account. |
0x0008 |
Device type. |
0x0010 |
Unique ID. |
0x0020 |
Phone. |
0x0040 |
Last message. |
0x0080 |
Created. |
0x0100 |
Custom fields. |
0x0200 |
Groups. |
0x0400 |
Deactivation. |
Unit groups (avl_unit_group)
| Value | Description |
|---|---|
0x0001 |
Name. |
0x0002 |
Creator. |
0x0004 |
Account. |
0x0008 |
Units. |
Accounts (avl_resource)
| Value | Description |
|---|---|
0x0001 |
Name. |
0x0002 |
Creator. |
0x0004 |
Parent account. |
0x0008 |
Billing plan. |
0x0010 |
Dealer rights. |
0x0020 |
Units. |
0x0040 |
Balance. |
0x0080 |
Days. |
0x0100 |
Status. |
0x0200 |
Blocked. |
0x0400 |
Activated units. |
Retranslators (avl_retranslator)
| Value | Description |
|---|---|
0x0001 |
Name. |
0x0002 |
Creator. |
0x0004 |
Account. |
0x0008 |
Protocol. |
0x0010 |
Server. |
0x0020 |
State. |
0x0040 |
Units for retranslation. |
0x0080 |
Unit unique ID. |
Response
If the request is completed successfully, an XLSX file is returned.
If the request fails, an error code is returned.
Error codes
| Error code | Description |
|---|---|
| 4 | Wrong input parameters, failed to get the current user, or the search failed. |
| 5 | Failed to create the file. |