REST URLs vs device names

This is a legacy forum which is locked for new topics. New topics should be started in one of the other forums under Extending Indigo
Forum rules
This is a legacy forum which is locked for new topics. New topics should be started in one of the other forums under Extending Indigo
rhanson
Posts: 198
Joined: Tue Apr 30, 2013 6:31 pm

REST URLs vs device names

Post 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...
User avatar
jay (support)
Site Admin
Posts: 19232
Joined: Wed Mar 19, 2008 11:52 am
Location: Austin, Texas
Contact:

Re: REST URLs vs device names

Post 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.
Jay (Indigo Support)
Twitter | Facebook | LinkedIn
Locked

Return to “Extending Indigo with Plugins and Python”