Volatil3
Volatil3

Reputation: 14998

MTurk API: Unable to see my created HIT on dashboard

I am using the tutorial given here. It says HIT is created but when I go here https://requestersandbox.mturk.com/ I don't find the project I created. Though individual worker URL does return HIT web interface.

The reason I want to know that I want not only to automate HIT creation but publishing of batch as well. My code is given below:

MTURK_SANDBOX = 'https://mturk-requester-sandbox.us-east-1.amazonaws.com'
    mturk = boto3.client('mturk',
                         aws_access_key_id=ACCESS_KEY,
                         aws_secret_access_key=SECRET,
                         region_name='us-east-1',
                         endpoint_url=MTURK_SANDBOX
                         )

    print("I have $" + mturk.get_account_balance()['AvailableBalance'] + " in my Sandbox account")

    question = open('questions.xml', encoding='utf8').read()
    new_hit = mturk.create_hit(
        Title='Is this Tweet happy, angry, excited, scared, annoyed or upset?',
        Description='Read this tweet and type out one word to describe the emotion of the person posting it: happy, angry, scared, annoyed or upset',
        Keywords='text, quick, labeling',
        Reward='0.15',
        MaxAssignments=1,
        LifetimeInSeconds=172800,
        AssignmentDurationInSeconds=600,
        AutoApprovalDelayInSeconds=14400,
        Question=question,
    )
    print("A new HIT has been created. You can preview it here:")
    print("https://workersandbox.mturk.com/mturk/preview?groupId=" + new_hit['HIT']['HITGroupId'])
    print("HITID = " + new_hit['HIT']['HITId'] + " (Use to Get Results)")

Upvotes: 3

Views: 1165

Answers (1)

Trenton
Trenton

Reputation: 11996

Mechanical Turk currently doesn't provide a way to publish a batch of HITs through the API. You must call CreateHIT for each of of them individually.

Also, HITs created through the API aren't visible in the UI. You can see these through the API. You can also use the AWS command line shell to manage them, since it uses the API, too.

Sources:

  1. https://blog.mturk.com/tutorial-managing-mturk-hits-with-the-aws-command-line-interface-56eaabb7fd4c
  2. MTurk HITs created Through Java API are not showing on Manage Tab on UI

Upvotes: 7

Related Questions