다음을 통해 공유


API Mashup Series: Part I

In previous days we have been working in new exciting ways to get you started with your Windows 8 development. Several starter kits have been created to show you how to create apps based on well-known web service API's such as Twitter, Bing Maps, Meetup, and APIs from Mashery such as Rotten Tomatoes, Tom-Tom and Univision.

 

The Code

The APIMASH includes starter kits in XAML/C# and HTML/JavaScript that will help you quickly get started using these APIs, and into the Windows Store.

You can download all the starter kits from: https://github.com/apimash/StarterKits

Check the different examples and let us know if you would like to see a starter kit with any other public API, or the ideas you would like to implement with kits we created.

 

The Univision API

The rest of this series will focus on a simple example created around the Univision Starter Kit, but you can follow any of the excellent examples created for APIMASH.

 

This starter kit is not a true mashup, but it is a simple example to help you grasp the basic concepts behind the starter kits and create your own app. It was created using XAML and C#.  

 

Getting Ready for the API Mash

To be able to test and modify the different kits you may configure your computer with the following:

1. Mac users only:  Boot CampParallels DesktopVirtualBox or VMWare Fusion

2. Windows 8 (a 90-day evaluation version available here)

3. Visual Studio 2012 Express for Windows 8 (free)

 

To publish to the Windows Store you will also need a Windows Store developer account:

1. If you are a student, use the DreamSpark benefits for a free account

2. If you are an MSDN Subscriber, use the one-time free account benefit associated with MSDN

3. Otherwise, the account is $49 per annum, but with your first published app, your cost is covered via the Keep The Cash promotion (subject to Terms and Conditions)!

 

To follow in detail the rest of this post series you should download the Univision Starter Kit . Other kits may need additional installation steps, like Newtonsoft’s Json , but you can find the appropriate instructions in each project.

 

Lastly, for continued learning and access to other programs focused on Windows 8 and Windows Phone development, we highly recommend signing up for the free App Builder program.

 

Mashery and the keys to the APIs

Many of the APIs used in the different kits are managed by Mashery and require you to obtain a key to identify your app in every call made.

To be able to test and modify the Univision Starter Kit you should register in Mashery to obtain your developer key.

 

You will have to fill a form with your basic information:

 After that you can explore the site. A good place to start is the Mashery API Explorer:

 

There you can find a list of popular APIs and, in some cases, test the different calls to each one of them.

 

To continue with our example please pick the Univision API:

At this point you have no key for Univision's API. Follow Mashery's advice and click on the link presented:

 This will redirect you to Univision's site, where you should click in the tab API

 

At the end of that page you should look for "Register here for an API key:" If you are already registered in Mashery you should only sign in again and you will be directed to this page:

 Please click the button and fill the information of your API, that can be changed later.

Agree to the terms and register your application:

Now you have a key that will be emailed to you and stored in your Mashery account. This value will be needed to test the Univision Starter Kit.

 

At this point you can go back to Mashery and test different calls to the Univision API or directly start testing the Starter Kit.

 

 

Opening the Starter Kit

After downloading the starter kits from the APIMash Home locate the .ZIP file and unzip it in the folder of your preference. You will find all the starter kits, so feel free to explore them.

In the Univision Starter Kit folder you should look for the solution of the project and double click it:

This will open the starter kit in Visual Studio where you should find the file Globals.cs

In this class you can change the line 20 to include the key obtained in Univision's site.

After this you should be able to run and test the application hitting F5.

This will show you the result of the default query to the Univision's API: News.

 

This concludes the first post related to the Univision starter kit. In following posts I will explain in more detail different aspects of this project that should help you to understand the code and get you on your way to create your first API based App.