Tutorial: Setting up your AWS Account to make use of MTurk’s API

Earlier this year, Amazon Mechanical Turk (MTurk) introduced the ability to use the MTurk Application Programming Interface (API) from the Amazon Web Services (AWS) Software Development Kit (SDK)and Command Line Interface (CLI). This lets Requesters use the MTurk API from any of nine AWS SDKs that are already widely used in the AWS community. These include support for languages such as Python, Node.js, Javascript, Java.NET (including C# and F#), Ruby, Go, PHP, and C++. This makes the MTurk API easier to use and more accessible than ever.

We’ve previously published tutorials showing how to use the SDKs and CLI. In today’s tutorial, we are going to show you how to register for AWS, link your account to your MTurk Requester account, then secure and retrieve your AWS Security Credentials with the AWS Identity and Access Management (IAM). At the end of the tutorial, you’ll will have:

  • An AWS Secret Access Key (e.g., wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY)

Let’s get started.

I. Register for Amazon Web Services

In step 1, you’ll register for an account with Amazon Web Services

In this step, we will setup an Amazon Web Services (AWS) account. Simply follow the steps below:

  1. Visit http://aws.amazon.com/
  2. Click the button to “Create an AWS Account”
  3. On the next page, provide your Email Address, Password, and AWS Account Name (you can change this name in your account settings after sign up).
  4. Click “Continue” to proceed

Next, you’ll provide your contact information. If you’re registering as an individual, select “Personal” and if you’re using MTurk as part of your business, select “Professional”

Complete the remaining fields with your information. Then click “Create Account and Continue” to proceed.

Next, you’ll be asked to provide a credit card for your AWS Account. This is separate from any payment instruments you may have on-file with your MTurk Requester account. Once you’ve completed this information, click the “Secure Submit” button to proceed.

Next, you’ll be asked to complete a brief phone verification step. Here, you are asked to provide a phone number where you can be reached, and to click the “Call Me Now” button to receive an automated phone call.

In this step, you’ll provide a phone number to receive an automated call from AWS…
…once you receive the call, you’ll input the number shown on your screen using your dial-pad…
…and that will verify your identity.

Once you’ve successfully verified your identity, click “Continue” to proceed.

In the last step before you’ve finished registration, select your AWS Support plan. For this tutorial, and unless you plan to use other AWS Services, simply select “Basic Plan” by clicking the “Free” button. You can change this selection at any time in the future.

Simply select the “Basic Plan” by clicking “Free” to continue

Congratulations! You’ve now completed registration for your Amazon Web Services account. Next, click “Sign in to the Console” for the next part of this tutorial.

II. Configure your AWS Account to use MTurk

Next we’ll configure your AWS Account using Identity and Access Management (IAM). If you haven’t already, click “Sign in to the Console” to proceed. You’ll be asked to enter the e-mail address and password you setup in Step 1.

From the AWS Console, type “IAM” in the search box and select “IAM — Manage User Account and Encryption Keys” when it appears

In this step, we are going to configure an IAM account (think of this like a “child” account of your parent AWS Account). IAM allows you to limit the services and capabilities of these “child” accounts, to help keep things more secure. In our case, we’ll limit our IAM account to only access MTurk.

To start, select “Users” on the left navigation menu, and click the “Add User” button at the top of the screen.

On the next screen, provide a name for your user (in our tutorial, we used ‘mturk-user’) and be sure to check the box for “Programmatic Access” since that will make sure we receive an AWS Access Key ID and AWS Secret Access Key for this IAM account. These are the keys we will use to make requests to the MTurk Requester API. Once complete, click “Next: Permissions” to proceed.

Be sure to check the “Programmatic access” box to receive an Access Key ID and Secret Access Key that you’ll use to call the MTurk Requester API with the AWS SDKs or AWS CLI.

On the next page, select to “Attach existing policies directly” then type “AmazonMechanicalTurkFullAccess” in the search field. This should result in one search result for the AmazonMechanicalTurkFullAccess policy. Click the Checkbox next to that row, then click the “Next: Review” button to proceed.

Be sure to click the checkbox next to AmazonMechanicalTurkFullAccess then click Next: Review to proceed

Click “Create User” on the next screen to proceed.

This final screen is important. Here you’re shown your AWS Access Key ID and your Secret Access Key. This is the only time you’ll be provided your AWS Secret Access Key, so it’s important that you store it somewhere secure. Don’t worry: if you ever lose this, you can regenerate another pair of AWS Access Key ID and Secret Access key in the AWS Console. To view your Secret Access Key, you’ll need to click the “Show” link.

Once you’ve stored these values somewhere secure, click “Close” to proceed.

III. Link your AWS Account to your MTurk Requester Account

Now, in the final step, we’re going to link your AWS Account with your MTurk Requester account.

Begin by visiting http://requester.mturk.com/developer. This page lists a series of steps similar to what you’ve just followed. In fact, you already completed Step 1 by following this tutorial. Nice work!

Now, we’re going to complete Step 2 from the MTurk Getting Started guide. In this step, you will “Link Your AWS Account with Your MTurk Requester Account” in order to make sure the AWS Access Key ID and AWS Secret Access Key know which MTurk Requester account you’re accessing when you use the MTurk API.

Now if you’ve followed this tutorial straight through, you’re probably still logged in to your AWS Account. If so, you’ll see a screen like the one below:

You’ll simply click “Link This Account” to complete the linking of your MTurk Requester account with the AWS Account you just created.

IV. Wrapping up and Next Steps

That’s it. Congratulations! You’ve just registered for Amazon Web Services, configured an IAM Account to securely access MTurk, and linked your MTurk Requester Account with your AWS Account.

At this point, you should have an AWS Access Key ID and AWS Secret Access Key ID that can be used to make calls to the MTurk API using the AWS SDKs or the AWS CLI.

If you’re a developer, check out “Step 5. Make Your First API Call” at the MTurk Developer Getting Started Guide for code samples in Python, Javascript, and Ruby.

If you’re simply looking to manage your HITs and perform simple API operations like ListHITs, SendBonus, or NotifyWorker, check out this tutorial on using the AWS CLI.

We hope you found this useful. If you have any questions, please post a question to our MTurk forums. To become a Requester, sign up here. Want to contribute as a Worker customer? Get started here.

One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.

The author has chosen not to show responses on this story. You can still respond by clicking the response bubble.