Roku Developer Program

Developers and content creators—a complete solution for growing an audience directly.
cancel
Showing results for 
Search instead for 
Did you mean: 
jpkilman
Level 7

external control search with multiple providers

I have firmware version 7.5 on my roku and I am able to pass the search commands implemented in the latest firmware without a problem with one exception.  When I use multiple providers or provider ids in a comma separated list as specified in the documentation I get error saying my command was invalid.  I have tried using a couple different methods for sending the command including invoking the web request from powershell in windows and using a chrome plugin.  I'm new to programming but working on an Amazon Alexa skill for roku control.  Right now my skill has to use the arrow commands to get to search, it would be nice to use this new search function built into the external control API.  Has anyone been able to get this working?  


Thanks 

John
0 Kudos
3 Replies
Roku Employee
Roku Employee

Re: external control search with multiple providers

"jpkilman" wrote:
When I use multiple providers or provider ids in a comma separated list as specified in the documentation I get error saying my command was invalid.


Are you URL-encoding the ',' as %2C in the URL?
0 Kudos
jpkilman
Level 7

Re: external control search with multiple providers

No I am not, like I said a bit new to this.  I will give that a shot, thanks 
0 Kudos
EnTerr
Level 8

Re: external control search with multiple providers

"Legally", commas are not required to be escaped in query strings.
RFC is a bit of morass on that and people sometimes mistakenly assume that everything that is "reserved character" has to be encoded everywhere, where in fact the mandate varies with the part of URI.
So, worth trying with %-encode, if in "practice" Roku code has erred on the side of recognizing only the unescaped unreserved chars.

PS. indeed, Roku is "illegally" picky:

~ $ curl -d '' 'http://192.168.1.26:8060/search/browse?keyword=lego&provider-id=12' -v
...
< HTTP/1.1 200 OK
...
* Connection #0 to host 192.168.1.26 left intact

~ $ curl -d '' 'http://192.168.1.26:8060/search/browse?keyword=lego&provider-id=12,13' -v   # appending ,13
...
< HTTP/1.1 400 Bad Request
...
* HTTP error before end of send, stop sending
* Closing connection 0

@Roku* - how about just using "+"?
I.e. `&provider-id=12+13` - after all "+" is the short encoding for space (vs %20 long form). And channel# tend to be space-free Smiley Happy. And `+` makes the URL more humane
0 Kudos