HTTP API - no parameters.firmware when also requesting empty group
AnsweredWe are trying to use the API for monitoring cameras.
NX version: 5.0.0.36634
When we do a GET request to /devices with `parameters.firmware` as well as `parameters.customGroupId` with `_keepDefault=true`, when we don't have a camera in a custom group, the result parameters section is empty.
API call:
`/rest/v1/devices?_format=JSON&_with=id,name,mac,model,parameters.firmware,status,vendor,parameters.customGroupId&_keepDefault=true&_orderBy=name`
Result:
```
[
{
"id": "{3213cee7-5af9-bcc2-83a6-08e30432c34a}",
"mac": "08-A1-89-FE-59-D1",
"model": "I91BM",
"name": "Back Yard",
"parameters": {
"customGroupId": "Back Yard",
"firmware": "V5.5.111 build 201223"
},
"status": "Recording",
"vendor": "HIKVISION"
},
{
"id": "{e82eecc2-abab-c425-ac69-c501dfa8f66b}",
"mac": "08-ED-ED-7D-F9-19",
"model": "IPC-HDW2431TM-AS-S2",
"name": "Front Cam",
"parameters": {},
"status": "Recording",
"vendor": "Dahua"
}
]
```
If `_keepDefault` is FALSE:
`/rest/v1/devices?_format=JSON&_with=id,name,mac,model,parameters.firmware,status,vendor,parameters.customGroupId&_keepDefault=false&_orderBy=name`
The result is:
```
[
{
"id": "{3213cee7-5af9-bcc2-83a6-08e30432c34a}",
"mac": "08-A1-89-FE-59-D1",
"model": "I91BM",
"name": "Back Yard",
"parameters": {
"customGroupId": "Back Yard",
"firmware": "V5.5.111 build 201223"
},
"status": "Recording",
"vendor": "HIKVISION"
},
{
"id": "{e82eecc2-abab-c425-ac69-c501dfa8f66b}",
"mac": "08-ED-ED-7D-F9-19",
"model": "IPC-HDW2431TM-AS-S2",
"name": "Front Cam",
"parameters": {
"firmware": "2.800.0000000.14.R, Build Date 2020-02-29"
},
"status": "Recording",
"vendor": "Dahua"
}
]
```
Is this expected? Or a bug?
-
Hi
Here is the link
Please sign in to leave a comment.
Comments
3 comments