Your Digital Media Has Never Looked So Good

Topic Author
Posts: 3
Joined: Tue Aug 11, 2015 1:17 pm

Device Linking using InstantTV for Channel Creation

Tue Aug 11, 2015 1:48 pm

I am using InstantTV for creating my channel. It was cool up until this point wherein I have to link my Channel to the Roku devices.

I was able to get the authorisation code in the TV (which in turn generates the registration xml file in my S3 bucket). However I dont have the server side code to validate the code and generate an response so that users can be linked.

The PHP code that they provided creates 2 xml files, one for linking and another for adding the user. here are the 2 sample files. Even if I upload these 2 files manually into my amazon buckets, that still doesnt work.

<?xml version="1.0" ?>

<?xml version="1.0" ?>

There are no sample server side code available anywhere to do this coding for the PHP. Got little lost. InstantTV support is also not forthcoming on how to set this up. Any guidance would definitely helpful.

I just need to know once the user enters the code in the website, What happens on the backhand, what are the files generated? how should those file be stored in the amazon bucket?
Posts: 28
Joined: Tue Jan 20, 2015 9:14 am

Re: Device Linking using InstantTV for Channel Creation

Wed Aug 12, 2015 9:52 am

Did you ask Scott at Instant TV Channel? He can pretty much do anything if you ask him.

User avatar
Posts: 90
Joined: Thu Jun 23, 2011 1:49 pm

Re: Device Linking using InstantTV for Channel Creation

Thu Aug 13, 2015 6:28 pm

If you want to handle the server-side operations yourself instead of using the free WordPress plugin, here's the API:

The Roku device writes the registration file to an S3 bucket and then displays a code on the TV screen that's actually the name of the file that it just wrote. Then the server uses that same code, provided by the subscriber, to read the registration file. Inside the registration file, among other things, is a token that is used as the filename of the linking file that the server writes to another S3 bucket. The Roku device knows what the token is (since it provided it to the server in the first place), and it uses the token to read its linking file from the S3 bucket. The linking file contains instructions from the server indicating whether or not the protected video is allowed to be played, whether or not to delete the token (subscriber didn't pay their bill) or an optional message to display to the subscriber.

You'll need to customize the linking file to match what's in the registration file, you can't just copy the example from the docs. At a minimum you'll have to name it the same as the token provided by the Roku device in the registration file.

The files in the account bucket are specific to the WordPress plugin. They allow the plugin to match up the files in the linking bucket to the WordPress login ID of the customers they belong to. The account files aren't written to or read by the Roku device, and if you aren't using the provided WordPress plugin then they aren't needed at all.

There IS sample server-side code provided on the Instant TV Channel documentation page at Here's the link to the code: It's non-obfuscated PHP with hopefully enough comments to let you know how it works. I think the API document will probably be more helpful than the code if you aren't using WordPress. The sample code is somewhat minimal, you might want to add a more extensive reporting system or integrate it directly into your subscriber management system.

- Scott - Build a Roku channel in 5 minutes!

Who is online

Users browsing this forum: No registered users and 13 guests