Repository navigation
Expand file tree
/
Copy pathswagger.yaml
More file actions
7840 lines (7269 loc) · 264 KB
/
Copy pathswagger.yaml
File metadata and controls
7840 lines (7269 loc) · 264 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
---
swagger: '2.0'
info:
title: Agent DVR
version: 8.3.7.0
description: |-
The local HTTP API of [Agent DVR](https://www.ispyconnect.com). Agent DVR serves it itself, so you need Agent installed and running. Everything below is relative to `http://localhost:8090` - change the host and port to suit your server.
## Calling the API
Every call is a plain HTTP request. Nearly all are `GET` with query string parameters; a few newer ones take a JSON body with `POST`. There are three families:
| Path | What it is |
|---|---|
| `/command/<name>` | Commands: do something now, change a setting, or read status. The same as `/command.cgi?cmd=<name>&...` |
| `/q/<name>` | Queries and the newer JSON calls. The same as `/q.json?cmd=<name>&...` |
| `/<name>.jpg`, `.mjpg`, `.mp4`, `.cgi` ... | Media: images, live and recorded video, audio |
Command names are not case sensitive. A name with no handler of its own under `/q/` is passed on to `/command/`, so most commands answer on both - but not the other way round: a call listed under `/q/` has to be made on `/q/`.
## Devices: ot, oid, group and location
Most calls act on a device, which is named by two numbers:
- `ot` - object type: `1` = microphone, `2` = camera
- `oid` - object ID: the number in front of the device's name at the top left of its settings in the web UI (`1: Front door` is `oid=1`). `/command/getObjects` lists every device with its id.
The on / off commands (`alertOn`, `record`, `scheduleOff` ...) can also be called without `oid`. They then run on every device, or only on the devices picked with `group` (one or more group names, comma separated - a device in any of them matches) and / or `location` (a location name). Both are case insensitive; a location name that does not exist is ignored. These calls are the ones whose `ot` and `oid` are optional.
## Authentication
By default, calls from the local network need no credentials. Switch on **Protect API** in Server Settings to require them; calls from outside the local network always need them. Credentials are a user account on the server, sent with HTTP Basic authentication (`Authorization: Basic <base64 of username:password>`). With Protect API on the account has to be an administrator, except for `getStatus` and `getCapabilities`.
## Responses
Commands answer in JSON with HTTP status 200, also when they fail:
| Response | Meaning |
|---|---|
| `{"status":"ok"}` | Done |
| `{"error":"Device not found","message":"Specify a valid control using oid and ot eg: ?ot=2&oid=1"}` | Failed. `message` is a hint and is not always there |
| `{"status":"error","error":"mode must be detected, notdetected or actionsonly"}` | Failed - the form the newer setting commands use |
| `{"status":"Command not found"}` | This version of Agent has no such command |
The `error` texts of the older commands are: `Device not found`, `Device type invalid for this api call`, `Device is disabled`, `Feature not enabled`, `Feature in use`, `Feature blocked`, `Feature not configured or has failed`, `System is disarmed`, `Action not found` and `Command failed`.
Media calls answer with the image, file or stream itself, or with HTTP status 404.
## Times
- **Epoch milliseconds** (`fromMs`, `winFromMs`, `from` ...) - milliseconds since 1970-01-01 UTC, as JavaScript's `Date.now()` gives
- **Ticks** (a recording's `c`, an alert's `time`, `history.mjpg?ticks=`) - .NET ticks: 100 nanosecond units since 0001-01-01 UTC. `ticks = milliseconds * 10000 + 621355968000000000`
## Versions
A call that was added recently says which version of Agent it needs. `/command/getCapabilities` reports what a server supports, so a client can check before using a newer call.
termsOfService: https://www.ispyconnect.com/terms.aspx
license:
name: Apache 2.0
url: http://www.apache.org/licenses/LICENSE-2.0.html
externalDocs:
description: Find out more about Agent DVR
url: https://www.ispyconnect.com/
host: localhost:8090
basePath: /
schemes:
- http
consumes:
- application/json
produces:
- application/json
tags:
- name: Server
description: Status, health and housekeeping of the server itself
- name: Arming and profiles
description: Arm and disarm the system or groups of devices, and apply profiles
- name: Devices
description: List, add, switch and set up cameras and microphones
- name: Schedule
description: Switch device schedules on and off, and apply them now
- name: Recording
description: Start and stop recording, set the recording mode, take photos and tag recordings
- name: Detection and alerts
description: The motion and sound detectors, and what raises an alert
- name: AI
description: Object, face, licence plate and sound recognition, and Ask AI
- name: Actions and tasks
description: Run and switch actions, tasks and plugin commands
- name: PTZ
description: Move cameras, PTZ presets and the PTZ scheduler
- name: Talk
description: Speak or play sounds through a camera, or through the server
- name: Live video and audio
description: Live images, video streams and audio streams
- name: Recordings and photos
description: List, view, summarise, import and delete recordings and photos
- name: Alert log
description: The alerts that have been raised
- name: FTP and cloud
description: Uploads of photos and recordings to FTP and cloud storage
- name: RTMP streaming
description: Stream cameras and views to an RTMP server (YouTube, Twitch ...)
- name: Assistant rules
description: Plain-language rules that compile to actions - the calls behind the MCP rule tools
- name: Analytics
description: 'People and vehicle counting: totals, zones, lines, occupancy, speed, alerts and sales. Needs a subscription'
parameters:
ot:
name: ot
in: query
required: true
type: integer
enum:
- 1
- 2
description: 'Object type ID of the device: 1 = microphone, 2 = camera'
oid:
name: oid
in: query
required: true
type: integer
description: Object ID of the device (the number in front of its name when you edit it)
otCamera:
name: ot
in: query
required: true
type: integer
enum:
- 2
description: Object type ID. This call is for cameras only, so always 2
otOptional:
name: ot
in: query
required: false
type: integer
enum:
- 1
- 2
description: 'Object type ID of the device: 1 = microphone, 2 = camera. Give it together with oid'
oidOptional:
name: oid
in: query
required: false
type: integer
description: Object ID of the device. Leave out oid and ot to run on every device, or on those picked with group and location
group:
name: group
in: query
required: false
type: string
description: 'Without oid: only devices in one of these groups (comma separated, case insensitive)'
location:
name: location
in: query
required: false
type: string
description: 'Without oid: only devices at this location (name, case insensitive)'
cameraOid:
name: oid
in: query
required: true
type: integer
description: Object ID of the camera
microphoneOid:
name: oid
in: query
required: true
type: integer
description: Object ID of the microphone
responses:
Ok:
description: 'Done: `{"status":"ok"}`. On failure the reply has an `error` instead - see Responses at the top of the page.'
schema:
$ref: '#/definitions/Status'
examples:
application/json: {status: ok}
paths:
# ============================================================================
# Server
# ============================================================================
/command/ping:
get:
tags:
- Server
summary: Check the server is running
description: |-
A lightweight health check: answers as soon as the server is up.
**Example**
```
GET http://localhost:8090/command/ping
```
operationId: command_ping
responses:
'200':
$ref: '#/responses/Ok'
/command/getStatus:
get:
tags:
- Server
summary: Get the server status
description: |-
A summary of the server: whether it is armed, how many devices there are and how many are switched on or recording, whether remote access is connected, and its id, name and version.
- `alertsUnread` and `lastAlertId` (v8.2.1.0+) - unread alerts as the web UI badges them, and the id of the newest alert (a higher value means a new alert). Both are -1 until the server has loaded them
- `devicesInError` (v8.2.1.0+) - devices that are switched on but failing to connect
- `updateVersion` (v8.2.1.0+) - the newer version of Agent that is available, or empty when up to date
- `serverTimeStamp` - the server's clock in ticks
Accepts any user account when Protect API is on.
**Example**
```
GET http://localhost:8090/command/getStatus
```
operationId: command_getStatus
responses:
'200':
description: The server summary
examples:
application/json:
armed: true
devices: 4
active: 3
recording: 1
remoteAccess: true
unique: 7bf498f7-0000-0000-0000-edc68dfb1e3d
name: HOME-SERVER
version: 8.3.7.0
serverTimeStamp: 639313592549212420
alertsUnread: 2
lastAlertId: 1041
devicesInError: 0
updateVersion: ''
/command/getCapabilities:
get:
tags:
- Server
summary: What this server supports
description: |-
The server's version, platform and time, a flag for each newer feature, its limits, and the list of commands open to integrations.
- `features` holds a `true` flag for each newer feature, so a client can check before using it. What matters is that the key is there
- `api` lists the commands an integration (the MCP server, for one) may call, with the access each needs: `read`, `control` or `configure`. Call them on `/q/` (for example `/q/getalerts`); where `args` is shown as `body:{...}`, POST that as a JSON body
- `limits` - the most recordings one `files-window` page returns, the size of the alert log, the longest side of a snapshot and the most frames `recordingframes` returns
- `serverTimeMs` and `timeZoneOffsetMinutes` - the server's clock (UTC epoch milliseconds) and its offset from UTC
A server from before this command existed answers `{"status":"Command not found"}`. Accepts any user account when Protect API is on.
**Example**
```
GET http://localhost:8090/command/getCapabilities
```
operationId: command_getCapabilities
responses:
'200':
description: What the server supports. `api` is cut short here
examples:
application/json:
version: 8.3.7.0
platform: Windows
unique: 7bf498f7-0000-0000-0000-edc68dfb1e3d
name: HOME-SERVER
serverTimeMs: 1796040000000
timeZoneOffsetMinutes: 60
features:
capabilities: true
recordingframes: true
filesWindow: true
streamfile: true
profiles: true
alertsJson: true
deviceError: true
getimage: true
streamThumb: true
relayApi: true
apiCatalog: true
mcpLocal: false
sheets: true
activitySummary: true
timelineSheet: true
rules: true
rulesQuiet: true
mcp: {enabled: false, path: /mcp}
api:
- {cmd: getstatus, tier: read, args: '', desc: 'Server summary: armed, version, device counts'}
- {cmd: switchon, tier: control, args: 'ot,oid', desc: Enable a device}
limits: {filesWindowMax: 500, maxAlerts: 100, snapshotMaxSide: 3000, recordingFramesMax: 16}
comms: {connected: true, server: '', connectionId: ''}
/command/getSystemStats:
get:
tags:
- Server
summary: Get CPU, memory and disk usage
description: |-
The server's load. `cpu_used`, `ram_free` and `disk_free` are ready-to-show text; `cpup`, `ramp` and `diskp` are the same as percentages used, and `ramu` is the memory in use. `disks` has one entry per storage location: `n` its path, `d` free space, `u` used space and `p` percent used.
**Example**
```
GET http://localhost:8090/command/getSystemStats
```
operationId: command_getSystemStats
responses:
'200':
description: The usage figures
examples:
application/json:
cpu_used: 25%
ram_free: 2.4GB
disk_free: 51.1GB
cpup: 25
ramp: 70
ramu: 5.6GB
diskp: 78
disks:
- {n: 'C:\', d: 51.1GB, u: 177.2GB, p: 78}
- {n: 'D:\Media', d: 835.3GB, u: 96.2GB, p: 10}
/command/checkRemote:
get:
tags:
- Server
summary: Check the remote access connection
description: |-
Whether the server is connected to the ispyconnect.com remote access service: `online` or `offline`.
Available from v6.6.8.0.
**Example**
```
GET http://localhost:8090/command/checkRemote
```
operationId: command_checkRemote
responses:
'200':
description: '`online` or `offline`'
examples:
application/json: {status: online}
/q/getSessionCount:
get:
tags:
- Server
summary: Count the connected clients
description: |-
How many client sessions (web UI, mobile apps ...) are connected to the server right now.
**Example**
```
GET http://localhost:8090/q/getSessionCount
```
operationId: q_getSessionCount
responses:
'200':
description: The number of sessions
examples:
application/json: {count: 2}
/q/gettags:
get:
tags:
- Server
summary: List the tags, locations and groups in use
description: |-
Every tag found on recordings, every tag found on photos, and the names of the server's locations and groups - the values the recording filters and the `group` and `location` parameters take.
Give `fn` with `ot` and `oid` to also learn where an archived recording was moved to: the reply then has a `path`.
**Example**
```
GET http://localhost:8090/q/gettags
```
operationId: q_gettags
parameters:
- name: fn
in: query
description: Filename of a recording. Adds its archive location as path when the recording has been archived. Needs ot and oid
required: false
type: string
- name: ot
in: query
description: 'Only with fn: object type ID of the recording''s device'
required: false
type: integer
enum:
- 1
- 2
- name: oid
in: query
description: 'Only with fn: object ID of the recording''s device'
required: false
type: integer
responses:
'200':
description: The lists, each in alphabetical order
examples:
application/json:
recordings: [car, manual, person]
photos: [manual]
locations: [Home, Office]
groups: [entrances, outside]
/command/broadcast:
get:
tags:
- Server
summary: Show a message on every connected client
description: |-
Sends a message that pops up in every web UI and app session connected to the server.
Available from v7.9.1.0.
**Example**
```
GET http://localhost:8090/command/broadcast?text=Back%20door%20is%20open
```
operationId: command_broadcast
parameters:
- name: text
in: query
description: The message to show
required: true
type: string
responses:
'200':
$ref: '#/responses/Ok'
/command/blockExternal:
get:
tags:
- Server
summary: Block external access
description: |-
Switches on Block External Access: access from outside the local network is refused until it is unblocked with `unblockExternal`.
**Example**
```
GET http://localhost:8090/command/blockExternal
```
operationId: command_blockExternal
responses:
'200':
$ref: '#/responses/Ok'
/command/unblockExternal:
get:
tags:
- Server
summary: Unblock external access
description: |-
Switches Block External Access off again.
**Example**
```
GET http://localhost:8090/command/unblockExternal
```
operationId: command_unblockExternal
responses:
'200':
$ref: '#/responses/Ok'
/command/runStorageMgmt:
get:
tags:
- Server
summary: Run storage management now
description: |-
Runs the storage manager straight away instead of waiting for its timer: old recordings are deleted or archived according to each storage location's limits. It runs in the background; `result` is `started`, or `running` when a pass was already under way.
**Example**
```
GET http://localhost:8090/command/runStorageMgmt
```
operationId: command_runStorageMgmt
responses:
'200':
description: '`started` or `running`'
examples:
application/json: {result: started}
/command/reloadObjects:
get:
tags:
- Server
summary: Reload the device list from disk
description: |-
Reloads the cameras and microphones from the configuration files and tells every connected client to refresh. Use after editing `objects.json` directly.
**Example**
```
GET http://localhost:8090/command/reloadObjects
```
operationId: command_reloadObjects
responses:
'200':
$ref: '#/responses/Ok'
/command/reloadConfig:
get:
tags:
- Server
summary: Reload the server configuration from disk
description: |-
Reloads the server configuration and then the device list from the configuration files, and tells every connected client to refresh. Use after editing the configuration files directly.
**Example**
```
GET http://localhost:8090/command/reloadConfig
```
operationId: command_reloadConfig
responses:
'200':
$ref: '#/responses/Ok'
/command/restart:
get:
tags:
- Server
summary: Restart Agent DVR
description: |-
Shuts Agent DVR down and starts it again. The API does not answer while it restarts.
**Example**
```
GET http://localhost:8090/command/restart
```
operationId: command_restart
responses:
'200':
$ref: '#/responses/Ok'
# ============================================================================
# Arming and profiles
# ============================================================================
/command/arm:
get:
tags:
- Arming and profiles
summary: Arm the system
description: |-
Arms the system, so devices with alerts switched on raise them. Give `disarmdelay` to have it disarm by itself afterwards.
**Example**
```
GET http://localhost:8090/command/arm
GET http://localhost:8090/command/arm?disarmdelay=30
```
operationId: command_arm
parameters:
- name: disarmdelay
in: query
description: Disarm again after this many minutes. Leave out to stay armed
required: false
type: integer
responses:
'200':
$ref: '#/responses/Ok'
/command/disarm:
get:
tags:
- Arming and profiles
summary: Disarm the system
description: |-
Disarms the system: no device raises alerts. Give `armdelay` to have it arm by itself afterwards.
**Example**
```
GET http://localhost:8090/command/disarm
GET http://localhost:8090/command/disarm?armdelay=60
```
operationId: command_disarm
parameters:
- name: armdelay
in: query
description: Arm again after this many minutes. Leave out to stay disarmed
required: false
type: integer
responses:
'200':
$ref: '#/responses/Ok'
/command/armgroups:
get:
tags:
- Arming and profiles
summary: Arm groups of devices
description: |-
Arms the system and switches alerts on for the devices in the named groups.
**Example**
```
GET http://localhost:8090/command/armgroups?groups=outside,garage
```
operationId: command_armgroups
parameters:
- name: groups
in: query
description: Group names, comma separated
required: true
type: string
- name: disarmdelay
in: query
description: Switch the groups' alerts off again after this many minutes
required: false
type: integer
responses:
'200':
$ref: '#/responses/Ok'
/command/disarmgroups:
get:
tags:
- Arming and profiles
summary: Disarm groups of devices
description: |-
Switches alerts off for the devices in the named groups. The system's own armed state is left as it is.
**Example**
```
GET http://localhost:8090/command/disarmgroups?groups=inside&armdelay=120
```
operationId: command_disarmgroups
parameters:
- name: groups
in: query
description: Group names, comma separated
required: true
type: string
- name: armdelay
in: query
description: Switch the groups' alerts on again after this many minutes
required: false
type: integer
responses:
'200':
$ref: '#/responses/Ok'
/command/getProfiles:
get:
tags:
- Arming and profiles
summary: List the profiles
description: |-
The server's profiles, in order. `id` is the index `setProfile`, `armProfile` and `disarmProfile` take; `active` marks the profile applied last.
**Example**
```
GET http://localhost:8090/command/getProfiles
```
operationId: command_getProfiles
responses:
'200':
description: The profiles
examples:
application/json:
profiles:
- {name: Home, active: true, id: 0}
- {name: Away, active: false, id: 1}
- {name: Night, active: false, id: 2}
/command/setProfile:
get:
tags:
- Arming and profiles
summary: Apply a profile by index
description: |-
Applies the profile to every device. From v8.1.1.0 a profile also restores each camera's object detection confidence (profiles saved before that leave it alone until they are saved again).
**Example**
```
GET http://localhost:8090/command/setProfile?ind=1
```
operationId: command_setProfile
parameters:
- name: ind
in: query
description: Index of the profile (its id from getProfiles; 0 = Home, 1 = Away, 2 = Night on a new install)
required: true
type: integer
responses:
'200':
$ref: '#/responses/Ok'
/command/setProfileByName:
get:
tags:
- Arming and profiles
summary: Apply a profile by name
description: |-
Applies the profile with this name. Nothing happens, and the reply is still ok, when no profile has the name.
**Example**
```
GET http://localhost:8090/command/setProfileByName?name=Away
```
operationId: command_setProfileByName
parameters:
- name: name
in: query
description: Name of the profile (case insensitive)
required: true
type: string
responses:
'200':
$ref: '#/responses/Ok'
/command/armProfile:
get:
tags:
- Arming and profiles
summary: Arm the system and apply a profile
description: |-
Arms the system, then applies the profile.
**Example**
```
GET http://localhost:8090/command/armProfile?ind=1
```
operationId: command_armProfile
parameters:
- name: ind
in: query
description: Index of the profile (its id from getProfiles)
required: true
type: integer
- name: disarmdelay
in: query
description: Disarm again after this many minutes
required: false
type: integer
responses:
'200':
$ref: '#/responses/Ok'
/command/disarmProfile:
get:
tags:
- Arming and profiles
summary: Disarm the system and apply a profile
description: |-
Disarms the system, then applies the profile.
**Example**
```
GET http://localhost:8090/command/disarmProfile?ind=0
```
operationId: command_disarmProfile
parameters:
- name: ind
in: query
description: Index of the profile (its id from getProfiles)
required: true
type: integer
- name: armdelay
in: query
description: Arm again after this many minutes
required: false
type: integer
responses:
'200':
$ref: '#/responses/Ok'
# ============================================================================
# Devices
# ============================================================================
/command/getObjects:
get:
tags:
- Devices
summary: List every device with its settings and state
description: |-
The whole device list as the web UI loads it. `objectList` has one entry per camera and microphone:
- `id` and `typeID` - the device's `oid` and `ot`
- `name`, `groups` (comma separated), `locationIndex` (into `locations`), `directory`, `notes`
- `function` - the run state `setObjectState` sets
- `data` - the live state, the same object `/q/getobjectstatus` returns
Beside it are `locations`, `alertGroups`, `profiles`, `directories` (storage locations), the saved `views` and `layouts`, and `settings` (server options the web UI needs). The reply is large.
**Example**
```
GET http://localhost:8090/command/getObjects
```
operationId: command_getObjects
responses:
'200':
description: The device list, cut down here to its main parts
examples:
application/json:
settings: {platform: Windows, isArmed: true, port: '8090'}
locations: [{name: Home, color: '#3cb44b', latlng: ''}]
objectList:
- name: Front door
groups: outside,entrances
id: 1
typeID: 2
locationIndex: 0
directory: FrontDoor
function: Modect
directoryID: 0
data:
online: true
recording: false
width: 1920
height: 1080
talk: false
minTrigger: 20
maxTrigger: 100
gain: 10
name: Front door
ptzid: -1
pairid: -1
ignoreaudio: false
sourcetype: ONVIF
ptztype: Digital
recordMode: 0
alertsActive: true
scheduleActive: true
alerted: false
connected: true
detected: false
detectorActive: true
mjpegStreamWidth: 1920
mjpegStreamHeight: 1080
connecting: false
videopreview: true
error: ''
analytics: false
color: '#3cb44b'
archiveInDatabase: true
iconIndex: 0
saveThumbs: true
notes: ''
profiles: [{name: Home, active: true, id: 0}]
/command/getObject:
get:
tags:
- Devices
summary: Get one device
description: |-
One device's entry from `getObjects`: its name, groups, location, run state (`function`) and live state (`data`).
**Example**
```
GET http://localhost:8090/command/getObject?ot=2&oid=1
```
operationId: command_getObject
parameters:
- &id001
$ref: '#/parameters/ot'
- &id002
$ref: '#/parameters/oid'
responses:
'200':
description: The device
examples:
application/json:
name: Front door
groups: outside,entrances
id: 1
typeID: 2
locationIndex: 0
directory: FrontDoor
function: Modect
directoryID: 0
data:
online: true
recording: false
width: 1920
height: 1080
talk: false
minTrigger: 20
maxTrigger: 100
gain: 10
name: Front door
ptzid: -1
pairid: -1
ignoreaudio: false
sourcetype: ONVIF
ptztype: Digital
recordMode: 0
alertsActive: true
scheduleActive: true
alerted: false
connected: true
detected: false
detectorActive: true
mjpegStreamWidth: 1920
mjpegStreamHeight: 1080
connecting: false
videopreview: true
error: ''
analytics: false
color: '#3cb44b'
archiveInDatabase: true
iconIndex: 0
saveThumbs: true
notes: ''
/q/getobjectstatus:
get:
tags:
- Devices
summary: Get the live state of one device
description: |-
What the device is doing now:
- `online` - switched on; `connected`, `connecting` and `error` - the state of its connection
- `recording`, `alerted`, `detected` - recording, alerting or detecting at this moment
- `alertsActive`, `detectorActive`, `scheduleActive` - whether its alerts, detector and schedule are switched on
- `recordMode` - 0 on detection, 1 on alert, 2 manual, 3 disabled, 6 constant
- `sourcetype`, and for cameras `width`, `height`, `talk` (has a talk channel), `ptzid` and `ptztype`
**Example**
```
GET http://localhost:8090/q/getobjectstatus?ot=2&oid=1
```
operationId: q_getobjectstatus
parameters:
- *id001
- *id002
responses:
'200':
description: The live state
examples:
application/json:
online: true
recording: false
width: 1920
height: 1080
talk: false
minTrigger: 20
maxTrigger: 100
gain: 10
name: Front door
ptzid: -1
pairid: -1
ignoreaudio: false
sourcetype: ONVIF
ptztype: Digital
recordMode: 0
alertsActive: true
scheduleActive: true
alerted: false
connected: true
detected: false
detectorActive: true
mjpegStreamWidth: 1920
mjpegStreamHeight: 1080
connecting: false
videopreview: true
error: ''
analytics: false
/q/loadobjects:
get:
tags:
- Devices
summary: List devices as the web client loads them
description: |-
The same reply as `/command/getObjects`. `ident` picks whose saved views, filters and floor plans are included.
**Example**
```
GET http://localhost:8090/q/loadobjects
```
operationId: q_loadobjects
parameters:
- name: ident
in: query
description: Ident of a user account, for that user's views, filters and floor plans. Leave out for the default account's
required: false
type: string
responses:
'200':
description: The device list, cut down here to its main parts
examples:
application/json:
settings: {platform: Windows, isArmed: true, port: '8090'}