Skip to content

Commit bab41b0

Browse files
committed
Add docs for the apps API endpoints
1 parent 872c37f commit bab41b0

File tree

1 file changed

+172
-0
lines changed

1 file changed

+172
-0
lines changed

docs/apps/inventory.md

Lines changed: 172 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,178 @@ Response:
156156
"machine_snapshot_commits": 13}
157157
```
158158

159+
### `/api/inventory/android_apps/export/`
160+
161+
* method: POST
162+
* Content-Type: application/json
163+
* required permission:
164+
* `inventory.view_androidapp`
165+
* optional parameters:
166+
* `export_format`: `csv` or `xlsx`. Defaults to `xlsx`.
167+
* `source`: The ID of an inventory source. Only Android apps collected via this source will be included in the export.
168+
* `last_seen`: `1d`, `7d`, `14d`, `30d`, `45d`, `90d`. Only Android apps collected within this time window will be included in the export.
169+
* `display_name`: A search string.
170+
171+
Use this endpoint to trigger an Android apps export task. The result of this task will be a spreadsheet.
172+
173+
Example:
174+
175+
```bash
176+
curl -XPOST \
177+
-H "Authorization: Token $ZTL_API_TOKEN" \
178+
-H 'Content-Type: application/json' \
179+
-d '{"display_name": "Chrome"}' \
180+
https://zentral.example.com/api/inventory/android_apps/export/\
181+
|python3 -m json.tool
182+
```
183+
184+
Response:
185+
186+
```json
187+
{
188+
"task_id": "b1512b8d-1e17-4181-a1c3-93a7243fddd3",
189+
"task_result_url": "/api/task_result/b1512b8d-1e17-4181-a1c3-93a7243fddd3/"
190+
}
191+
```
192+
193+
### `/api/inventory/deb_packages/export/`
194+
195+
* method: POST
196+
* Content-Type: application/json
197+
* required permission:
198+
* `inventory.view_debpackage`
199+
* optional parameters:
200+
* `export_format`: `csv` or `xlsx`. Defaults to `xlsx`.
201+
* `source`: The ID of an inventory source. Only Debian packages collected via this source will be included in the export.
202+
* `last_seen`: `1d`, `7d`, `14d`, `30d`, `45d`, `90d`. Only Debian packages collected within this time window will be included in the export.
203+
* `name`: A search string.
204+
205+
Use this endpoint to trigger a Debian packages export task. The result of this task will be a spreadsheet.
206+
207+
Example:
208+
209+
```bash
210+
curl -XPOST \
211+
-H "Authorization: Token $ZTL_API_TOKEN" \
212+
-H 'Content-Type: application/json' \
213+
-d '{"name": "Firefox", "last_seen": "90d"}' \
214+
https://zentral.example.com/api/inventory/deb_packages/export/\
215+
|python3 -m json.tool
216+
```
217+
218+
Response:
219+
220+
```json
221+
{
222+
"task_id": "b1512b8d-1e17-4181-a1c3-93a9243fddd3",
223+
"task_result_url": "/api/task_result/b1512b8d-1e17-4181-a1c3-93a9243fddd3/"
224+
}
225+
```
226+
227+
### `/api/inventory/ios_apps/export/`
228+
229+
* method: POST
230+
* Content-Type: application/json
231+
* required permission:
232+
* `inventory.view_iosapp`
233+
* optional parameters:
234+
* `export_format`: `csv` or `xlsx`. Defaults to `xlsx`.
235+
* `source`: The ID of an inventory source. Only iOS apps collected via this source will be included in the export.
236+
* `last_seen`: `1d`, `7d`, `14d`, `30d`, `45d`, `90d`. Only iOS apps collected within this time window will be included in the export.
237+
* `name`: A search string.
238+
239+
Use this endpoint to trigger an iOS apps export task. The result of this task will be a spreadsheet.
240+
241+
Example:
242+
243+
```bash
244+
curl -XPOST \
245+
-H "Authorization: Token $ZTL_API_TOKEN" \
246+
-H 'Content-Type: application/json' \
247+
-d '{"name": "1Password", "last_seen": "1d"}' \
248+
https://zentral.example.com/api/inventory/ios_apps/export/\
249+
|python3 -m json.tool
250+
```
251+
252+
Response:
253+
254+
```json
255+
{
256+
"task_id": "b1512b8d-1e17-4181-a1c3-83a9243fddd3",
257+
"task_result_url": "/api/task_result/b1512b8d-1e17-4181-a1c3-83a9243fddd3/"
258+
}
259+
```
260+
261+
### `/api/inventory/macos_apps/export/`
262+
263+
* method: POST
264+
* Content-Type: application/json
265+
* required permission:
266+
* `inventory.view_osxapp`
267+
* `inventory.view_osxappinstance`
268+
* optional parameters:
269+
* `export_format`: `csv` or `xlsx`. Defaults to `xlsx`.
270+
* `source`: The ID of an inventory source. Only macOS apps collected via this source will be included in the export.
271+
* `last_seen`: `1d`, `7d`, `14d`, `30d`, `45d`, `90d`. Only macOS apps collected within this time window will be included in the export.
272+
* `bundle_name`: A search string.
273+
274+
Use this endpoint to trigger a macOS apps export task. The result of this task will be a spreadsheet.
275+
276+
Example:
277+
278+
```bash
279+
curl -XPOST \
280+
-H "Authorization: Token $ZTL_API_TOKEN" \
281+
-H 'Content-Type: application/json' \
282+
-d '{"bundle_name": "1Password", "last_seen": "14d", "source": 4641}' \
283+
https://zentral.example.com/api/inventory/macos_apps/export/\
284+
|python3 -m json.tool
285+
```
286+
287+
Response:
288+
289+
```json
290+
{
291+
"task_id": "c1512b8d-1e17-4181-a1c3-83a9243fddd3",
292+
"task_result_url": "/api/task_result/c1512b8d-1e17-4181-a1c3-83a9243fddd3/"
293+
}
294+
```
295+
296+
### `/api/inventory/programs/export/`
297+
298+
* method: POST
299+
* Content-Type: application/json
300+
* required permission:
301+
* `inventory.view_program`
302+
* `inventory.view_programinstance`
303+
* optional parameters:
304+
* `export_format`: `csv` or `xlsx`. Defaults to `xlsx`.
305+
* `source`: The ID of an inventory source. Only Windows programs collected via this source will be included in the export.
306+
* `last_seen`: `1d`, `7d`, `14d`, `30d`, `45d`, `90d`. Only Windows programs collected within this time window will be included in the export.
307+
* `name`: A search string.
308+
309+
Use this endpoint to trigger a Windows programs export task. The result of this task will be a spreadsheet.
310+
311+
Example:
312+
313+
```bash
314+
curl -XPOST \
315+
-H "Authorization: Token $ZTL_API_TOKEN" \
316+
-H 'Content-Type: application/json' \
317+
-d '{"name": "1Password", "export_format": "csv"}' \
318+
https://zentral.example.com/api/inventory/programs/export/\
319+
|python3 -m json.tool
320+
```
321+
322+
Response:
323+
324+
```json
325+
{
326+
"task_id": "c2512b8d-1e17-4181-a1c3-83a9243fddd3",
327+
"task_result_url": "/api/task_result/c2512b8d-1e17-4181-a1c3-83a9243fddd3/"
328+
}
329+
```
330+
159331
### `/api/inventory/machines/export_android_apps/`
160332

161333
* method: POST

0 commit comments

Comments
 (0)