About this SDK
The Amazon Mechanical Turk SDK for .NET is a set of libraries and tools designed to make it easier for you to build solutions leveraging Amazon Mechanical Turk. The goals of the SDK are:- To abstract you from the "muck" of using web services
- To simplify using the various Amazon Mechanical Turk APIs
- To allow you to focus more on solving the business problem and less on managing technical details
About the Open Source Project
Visit the Amazon Mechanical Turk SDK for .NET project homepage. We believe that the developer community is an integral part of making Mechanical Turk easier to use for everyone. Releasing the code to the open source community is the first step in creating an environment of innovation and collaboration with our customers.Usage
using Amazon.WebServices.MechanicalTurk;
using Amazon.WebServices.MechanicalTurk.Domain;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
SimpleClient client = new SimpleClient();
HIT h = client.CreateHIT(
"My first HIT", // title
"This is my first HIT I created to entertain myself", // description
1, // Reward (one dollar)
"What are the top 10 differences between Nietzsche and Schwarzenegger?", // Question
1); // # of assignments
Console.WriteLine("Created HIT: {0} ({1})", h.HITId, client.GetPreviewURL(h.HITTypeId));
Console.Write("Press 'Enter' to end ...");
Console.ReadLine();
}
}
}
For more in-depth example code, check out the samples folder included in the distribution.
Prerequisites
To use the SDK and successfully run the samples, you must meet these prerequisites:- You must have an Amazon Web Services (AWS) account. You can sign up at the AWS web site: http://aws.amazon.com.
- You must have an Amazon Mechanical Turk Requester account. Be sure to use the same e-mail address and password you used when creating your Amazon Web Services account. You can sign up at the Requester web site: http://requester.mturk.com.
- You must have the .Net Framework 2.0 SDK or later. You can download the .NET Framework 2.0 SDK here.
- You must have a .Net development environment such as Visual Studio
Installation
The following instructions assume that you have Visual Studio installed.The installation of the SDK and other required components is simple and requires minimal configuration. Simply double-click "setup.exe" and follow the instructions.
Configure and use the Amazon Mechanical Turk SDK for .Net
The following steps are necessary to configure the SDK for use in the provided sample applications.- Configure the SDK to use your AWS identifier information (e.g. with Notepad):
a. Open the following file:
[SDK Installation Directory]\src\App.config
b. Set the following properties to reflect your AWS identifiers:MechanicalTurk.AccessKeyId=[Your AWS Access Key]
c. Save and close the file.
MechanicalTurk.SecretAccessKey=[Your Secret Key] - Open the sample projects solution in Visual Studio by doubleclicking
[SDK Installation Directory]\src\samples\MechanicalTurk.Samples.sln
- Compile and run the project in your IDE.
Running Sample Applications
Seven samples have been installed with the SDK and are located here:[SDK Installation Directory]\src\samples\...The samples are:
- HelloWorld: With this sample application, you create a HIT that asks a simple question, "What is the weather like right now in Seattle, WA?"
- SimpleSurvey: With this sample application, you create a HIT that conducts a quick survey on a worker's political party preferences by loading a question form from a file
- BestImage: With this sample application, you create a HIT that asks a worker to choose the best image of three given a set of criteria. It shows how to use use question forms with formatted contents
- SiteCategorization: With this sample application, you create HITs asking workers to categorize websites and it demonstrates bulk loading of HITs into Mechanical Turk
- Reviewer: With this sample application, you retrieve and approve the results of your HITs that have been submitted.
- HitReport: With this sample application, you output status information of all your active HITs to the console.
- CreateHitUI: With this sample WinForms application, you can interactively create HITs and view them as they are appear on the Mechanical Turk Worker website.