Page 1 of 1

REST URLs vs device names

PostPosted: Thu May 23, 2013 2:23 am
by rhanson
Hi all,

How are people dealing with mapping human-readable device/action names to URL-appropriate names so that REST URLs are valid?

Jack's Bedroom Light => jacks-bedroom-light

- Is there a way to add additional methods in the webserver that are just pointers to valid methods? If so, I could create my own variations on jacks-bedroom-light.

- Is there a separate field that can be used to specify url-safe text instead of using the device name?

- Any way to make the device ID work?

When integrating with Siri, iMessage, other voice controlled things, there really isn't a chance to go through and fix capitalization, spacing and other issues. Having additional URLs would be one workaround. Or I could run text through some logic to guess at the right device/action name.

Open to all suggestions...

Re: REST URLs vs device names

PostPosted: Thu May 23, 2013 9:38 am
by jay (support)
The RESTful API was designed and built well before the Python API and the introduction of unique object IDs. In some future version we'll move the RESTful API over to use the python api at which point we can expose the IDs.

URL encoding the names before use is the right way to go - that should take care of special characters.