Option 'device_token'

Hi,
I’m developing a package with a service. Among the many things this service does, I also need to be able to make Post requests to the hosted API. Looking at hosted.py, there’s an option to obtain a on_device_token to request an adhoc key and make requests. However, I don’t understand how to obtain the device_token so it can be displayed in the config.json and be able to make requests with the service. When I configure the option in node.json, the device_token isn’t listed in the setup created with the package (which I’m developing) (device_token: “” is empty in the config.json), and there’s no documentation to create it if necessary.

Can you give me some guidance on how to address this?

Thanks.

You need to create a new access, then in the access list, use Access action and select “Enable” for “on-device access”. Once that’s done, the access will be selectable as a setup config option. Be careful with what actions you allow through that access.

Thanks, I had completely overlooked the “On-device access” option.

I understand the risk of allowing access, but I’m looking for the simplest way to display a JSON (generated by the service) in the configuration options (read-only). After reading the documentation and doing a lot of research, I don’t know if there’s any other internal method to display the JSON generated on the device in the configuration options.

There isn’t. No data from the device is directly accessible in the setup configuration. There’s no back channel.

1 Like