We are using The Things Stack v.3.8 on Docker. Is there any option to get device metadata (Name , Description, Location, …) by device_id using the End Device API?
When I used a HTTP binding of EndDeviceRegistry.Get method,
GET /api/v3/applications/{end_device_ids.application_ids.application_id}/devices/{end_device_ids.device_id}
I only received the ids (device_id, application_id, dev_eui, join_eui) and the timestamps (created, updated).
When using the HTTP API to get information about end devices, you need to:
Query the service(s) that “owns” the fields you’re interested in. The API Reference has an overview of which fields are owned by which service. In your case, all fields are “owned” by the EndDeviceRegistry service of the Identity Server.
Specify the fields you want to receive in the “field mask”. You can do this by writing the field paths in the query string. In your case, it would be ?field_mask=name,description,locations to get the name, description and locations fields.
We should probably document this second point better (cc: @benolayinka)
There is a mention of the field mask, but there is not stated a form and a structure for the HTTP API. Whether it is an HTTP parameter (?field_mask or ?field-mask or ?fieldmask), or a special default setting for the Identity Server in stack config ttn-lw-stack.yml file, e.g.:
is:
# Email configuration for "thethings.example.com"
email:
sender-name: 'The Things Stack'
...
# Special default setting mentioned above
api:
field-mask: '<name>,<description>, ...'
Thank you for your explanation. It is clear to me, now.
@mmiskov, thanks for your feedback. I’ve pushed an update to our documentation which I hope clarifies exactly the question you have. If you have time, take a look at the pull request and let us know if it looks clear to you.