GetAssignmentsForHIT - Amazon Mechanical Turk


                WARNING

You are browsing the documentation for a deprecated version ('2014-08-15') of the Amazon Mechanical Turk Requester API. This version of the API will be deprecated and will be rendered unusable as of June 1st, 2019.

If you request against a legacy API version (https://docs.aws.amazon.com/AWSMechTurk/latest/AWSMturkAPI-legacy/Welcome.html) on or after June 1, 2019, you will receive the following response:

This Requester API is no longer supported. Please use the latest API using the official AWS SDK. https://aws.amazon.com/getting-started/tools-sdks

The latest version of our API ('2017-01-17') provides you with additional tool choices and enables you to select from nine AWS Software Development Kits (SDKs) that have been widely adopted across the AWS community. This API can be accessed using the following AWS SDKs: Python/Boto (Boto3), Javascript (NodeJS or Browser), Java, .NET, Go, Ruby, PHP or C++. This version also makes it easier for customers to connect MTurk with other AWS services like S3, Lambda, Step Functions, Lex, Polly, Rekognition, Amazon SageMaker, AWS Batch, EC2, and more.

This version also updates naming conventions used in the API and adopts the AWS standard of Signature Version 4 to authenticate requests securely. The API uses REST requests and no longer requires that developers be familiar with SOAP protocol. These changes make the MTurk API consistent with AWS APIs, simplifying the on-boarding process for both new and existing AWS developers. The legacy MTurk Command Line Tools and .NET, Java, Ruby, and Perl SDKs were marked as deprecated in January 2018. We will be deprecating the legacy APIs as of June 1, 2019.

If you are on a legacy API, you must migrate to the latest version of our API. You can find documentation for the latest API here and the AWS SDKs here. Please check whether you need to migrate and review the technical migration guide.

For support, contact requestor-apilegacydeprecation-support@amazon.com.

 

GetAssignmentsForHIT

Description

The GetAssignmentsForHIT operation retrieves completed assignments for a HIT. You can use this operation to retrieve the results for a HIT.

You can get assignments for a HIT at any time, even if the HIT is not yet Reviewable. If a HIT requested multiple assignments, and has received some results but has not yet become Reviewable, you can still retrieve the partial results with this operation.

Use the AssignmentStatus parameter to control which set of assignments for a HIT are returned. The GetAssignmentsForHIT operation can return submitted assignments awaiting approval, or it can return assignments that have already been approved or rejected. You can set AssignmentStatus=Approved,Rejected to get assignments that have already been approved and rejected together in one result set.

Only the Requester who created the HIT can retrieve the assignments for that HIT.

Results are sorted and divided into numbered pages and the operation returns a single page of results. You can use the parameters of the operation to control sorting and pagination.

Request Parameters

The GetAssignmentsForHIT operation accepts parameters common to all operations. Some common parameters are required. See Common Parameters for more information.

The following parameters are specific to the GetAssignmentsForHIT operation:

Name Description Required

Operation

The name of the operation

Type: String

Valid Values: GetAssignmentsForHIT

Default: None

Yes

HITId

The ID of the HIT for which completed assignments are requested.

Type: String

Default: None

Yes

AssignmentStatus

The status of the assignments to return.

Type: String

Valid Values: Submitted | Approved | Rejected

Default: None. If not specified, the operation returns all assignments that have been submitted, including those that have been approved or rejected.

Note: Set AssignmentStatus=Approved,Rejected to get assignments that have been approved and rejected together in one result set.

No

SortProperty

The field on which to sort the results returned by the operation.

Type: String

Valid Values: AcceptTime | SubmitTime | AssignmentStatus

Default: SubmitTime

SortDirection

The direction of the sort used with the field specified by the SortProperty parameter.

Type: String

Valid Values: Ascending | Descending

Default: Ascending

No

PageSize

The number of assignments to include in a page of results. The complete sorted result set is divided into pages of this many assignments.

Type: positive integer

Valid Values: any integer between 1 and 100

Default: 10

No

PageNumber

The page of results to return. Once the assignments have been filtered, sorted, and divided into pages of size PageSize, the page corresponding to PageNumber is returned as the results of the operation.

Type: positive integer

Default: 1

No

Response Elements

A successful request for the GetAssignmentsForHIT operation has a GetAssignmentsForHITResult element in the response.

The GetAssignmentsForHITResult element contains the following elements:

Name Description

NumResults

The number of assignments on the page in the filtered results list, equivalent to the number of assignments returned by this call.

Type: non-negative integer

PageNumber

The number of the page in the filtered results list being returned.

Type: positive integer

TotalNumResults

The total number of HITs in the filtered results list based on this call.

Type: positive integer

Assignment

The assignment. The response includes one Assignment element for each HIT returned by the query.

Type: an Assignment data structure

Examples

The following example shows how to use the GetAssignmentsForHIT operation.

Sample Request

The following example retrieves five assignments for a HIT, using the default sort order (SubmitTime) and direction (Ascending).

https://mechanicalturk.amazonaws.com/?Service=AWSMechanicalTurkRequester &AWSAccessKeyId=[the Requester's Access Key ID] &Version=2017-01-17 &Operation=GetAssignmentsForHIT &Signature=[signature for this request] &Timestamp=[your system's local time] &HITId=123RVWYBAZW00EXAMPLE &PageSize=5 &PageNumber=1

Sample Response

The following is an example response.

<GetAssignmentsForHITResult> <Request> <IsValid>True</IsValid> </Request> <NumResults>1</NumResults> <TotalNumResults>1</TotalNumResults> <PageNumber>1</PageNumber> <Assignment> <AssignmentId>GYFTRHZ5J3DZREY48WNZE38ZR9RR1ZPMXGWE7WE0</AssignmentId> <WorkerId>AD20WXZZP9XXK</WorkerId> <HITId>GYFTRHZ5J3DZREY48WNZ</HITId> <AssignmentStatus>Approved</AssignmentStatus> <AutoApprovalTime>2009-08-12T19:21:54Z</AutoApprovalTime> <AcceptTime>2009-07-13T19:21:40Z</AcceptTime> <SubmitTime>2009-07-13T19:21:54Z</SubmitTime> <ApprovalTime>2009-07-13T19:27:54Z</ApprovalTime> <Answer> <?xml version="1.0" encoding="UTF-8"?> <QuestionFormAnswers xmlns="http://mechanicalturk.amazonaws.com/AWSMechanicalTurkDataSchemas/2005-10-01/QuestionFormAnswers.xsd"> <Answer> <QuestionIdentifier>Question100</QuestionIdentifier> <FreeText>Move to X.</FreeText> </Answer> </QuestionFormAnswers> </Answer> </Assignment> </GetAssignmentsForHITResult>