How to Send Updates to Flixster & Netflix
Flixster and Netflix include an API to which you can connect and send updates. The API lists several functions to interface with your readers' preferred movies and searches. Each API has its own documentation and code specifics, so you must connect and update API searches separately in your code. The Web app connection to the two APIs is invisible to your users, so it does not interrupt their use of your app.
Instructions
-
Netflix
-
1
Open Visual Studio on your desktop, and open the Web project you want to use to connect to the Netflix API. Double-click the form source code file to load the coding editor.
-
2
Create a connection to the Netflix API. Copy and paste the following code with your own Netflix API username and password:
Uri url = new Uri("http://api.netflix.com/catalog/titles/");
o.AddQueryParameter("username", "password"); -
-
3
Create the update procedure. You can update your user queue using the Netflix API. In this example, a title is added to the user's queue:
Uri url = new Uri("http://api.netflix.com/users/userID/queues/instant");
o.AddQueryParameter("title_ref", "Movie to Add");
o.AddQueryParameter("position", "1");The movie "Movie to Add" is added to the first position of the user's queue.
Flixster
-
4
Open the Visual Studio software and the Web project. Open the Web code file to load the file in the editor.
-
5
Make a URL connection to the remote API app. The following code makes the connection you need before calling the functions:
Uri uri = new Uri("api.rottentomatoes.com/api/public/v1.0/lists/movies/box_office.json?limit=16&country=us");
-
6
Update the search parameters for the list of movies. Flixster lets you search for movies and reviews. The following code sends an update for the movie search:
o.AddQueryParameter("search", "New Movie Search");
Replace "New Movie Search" with your own criteria.
-
1