Amazon Mechanical Turk SDK for .NET

Sample Code & Libraries>Amazon Mechanical Turk>Amazon Mechanical Turk SDK for .NET
Community Contributed Software

  • Amazon Web Services provides links to these packages as a convenience for our customers, but software not authored by an "@AWS" account has not been reviewed or screened by AWS.
  • Please review this software to ensure it meets your needs before using it.

The Amazon Mechanical Turk SDK for .NET is an open source CodePlex project containing a set of libraries and tools designed to make it easier for you to build solutions leveraging Amazon Mechanical Turk in .NET.

Details

Submitted By: JohnM@AWS
AWS Products Used: Amazon Mechanical Turk
Language(s): C#
License: Apache License 2.0
Created On: August 15, 2007 11:42 PM GMT
Last Updated: February 6, 2013 11:18 PM GMT
Download

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.
  1. 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]
    MechanicalTurk.SecretAccessKey=[Your Secret Key]
    c. Save and close the file.

  2. Open the sample projects solution in Visual Studio by doubleclicking
    [SDK Installation Directory]\src\samples\MechanicalTurk.Samples.sln
  3. 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.
Running the samples requires that you have the AWS identifier information configured as described above.

To run a specific sample, right-click on it in the Solution Explorer window of Visual Studio and select "Set as StartUp Project". Then press F5 to debug or Ctrl+F5 to run the sample without debugging.

The default StartUp Project is configured to be the CreateHitUI sample application.

Comments, Questions or Feedback

If you have any comments, questions, or feedback concerning the Amazon Mechanical Turk SDK for .NET, please visit the CodePlex project page.

If you have any comments, questions, or feedback concerning the Mechanical Turk service in general, please visit the Amazon Mechanical Turk discussion forums

Comments

ExternalHIT
Why doesn't .NET SDK include the ExternalHIT example? Where can I find this sample in C#?
askquestions on March 10, 2009 5:47 PM GMT
Thanks for catching that
Thanks for catching that typo. Fixed.
Mark@AWS on October 9, 2007 3:49 PM GMT
broken link
This link "Amazon Mechanical Turk SDK for .NET " actually points to Turk SDK for Perl The code below the link shows C#
Dana Reed on October 9, 2007 3:39 PM GMT
We are temporarily not accepting new comments.
©2014, Amazon Web Services, Inc. or its affiliates. All rights reserved.