Query for serial number from DeviceID

I’m trying to query a device by serial number through the API. There is a chicken/egg problem I’d like to resolve

By default, the InternetGatewayDevice.DeviceInfo.SerialNumber is not populated on our system. I can’t populate it via the API because I don’t know the full device id yet so I can’t call refreshObject

So I try to query for DeviceID.SerialNumber but I get blank returns from the query. e.g my encoded query is:
http://172.28.103.40:7557/devices/?query={“DeviceID.SerialNumber”%3A"ALCLFC00FF91"}"&"projection=_id

and I receive a “[\n\n]” response.

Since this is an internal Genie object (DeviceID), is there a different way to query it? I see some objects have a leading underscore like _id which seems to equate to DeviceID.ID. On that basis I tried _serialNumber and _id._serialNumber without success.

1 Like

you could download the entire devices list and filter it using an external tool like grep, but what are you really trying to do with this ?

Give this query a try

http://172.28.103.40:7557/devices/?query={"_deviceId._SerialNumber": "ALCLF00FF91"}&projection=_id
3 Likes

Devices are installed in home by contractors. They just about know how to phone in the serial number they just installed. We want to search for that serial number to get the device name and the simplest way was to use the inbuilt Genie object name. We could set up (and I have done for testing) to retrieve the InternetGateway… SerialNumber but our preference was to keep the retrieved objects to the minimum number (this could be a huge database). Since the S/N is there already, just trying to address it in the query rather than add another instance of the same value in the DB.

I’ll use Magnus suggestion. I was just one upper/lower case away from success. :slight_smile:

Thank you Magnus, I was just one uppercase away from success. your suggestion worked.

It’s ok. I had to ask because it sounded kinda strange to me. What we do is to keep track of the devices in possession of contractor and select the appropriate one at the moment of authorizing the connection.

sry about the off-topic.