MTurk / Client / list_assignments_for_hit

list_assignments_for_hit#

MTurk.Client.list_assignments_for_hit(**kwargs)#

The ListAssignmentsForHIT 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 ListAssignmentsForHIT 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.

See also: AWS API Documentation

Request Syntax

response = client.list_assignments_for_hit(
    HITId='string',
    NextToken='string',
    MaxResults=123,
    AssignmentStatuses=[
        'Submitted'|'Approved'|'Rejected',
    ]
)
Parameters:
  • HITId (string) –

    [REQUIRED]

    The ID of the HIT.

  • NextToken (string) – Pagination token

  • MaxResults (integer) –

  • AssignmentStatuses (list) –

    The status of the assignments to return: Submitted | Approved | Rejected

    • (string) –

Return type:

dict

Returns:

Response Syntax

{
    'NextToken': 'string',
    'NumResults': 123,
    'Assignments': [
        {
            'AssignmentId': 'string',
            'WorkerId': 'string',
            'HITId': 'string',
            'AssignmentStatus': 'Submitted'|'Approved'|'Rejected',
            'AutoApprovalTime': datetime(2015, 1, 1),
            'AcceptTime': datetime(2015, 1, 1),
            'SubmitTime': datetime(2015, 1, 1),
            'ApprovalTime': datetime(2015, 1, 1),
            'RejectionTime': datetime(2015, 1, 1),
            'Deadline': datetime(2015, 1, 1),
            'Answer': 'string',
            'RequesterFeedback': 'string'
        },
    ]
}

Response Structure

  • (dict) –

    • NextToken (string) –

      If the previous response was incomplete (because there is more data to retrieve), Amazon Mechanical Turk returns a pagination token in the response. You can use this pagination token to retrieve the next set of results.

    • NumResults (integer) –

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

    • Assignments (list) –

      The collection of Assignment data structures returned by this call.

      • (dict) –

        The Assignment data structure represents a single assignment of a HIT to a Worker. The assignment tracks the Worker’s efforts to complete the HIT, and contains the results for later retrieval.

        • AssignmentId (string) –

          A unique identifier for the assignment.

        • WorkerId (string) –

          The ID of the Worker who accepted the HIT.

        • HITId (string) –

          The ID of the HIT.

        • AssignmentStatus (string) –

          The status of the assignment.

        • AutoApprovalTime (datetime) –

          If results have been submitted, AutoApprovalTime is the date and time the results of the assignment results are considered Approved automatically if they have not already been explicitly approved or rejected by the Requester. This value is derived from the auto-approval delay specified by the Requester in the HIT. This value is omitted from the assignment if the Worker has not yet submitted results.

        • AcceptTime (datetime) –

          The date and time the Worker accepted the assignment.

        • SubmitTime (datetime) –

          If the Worker has submitted results, SubmitTime is the date and time the assignment was submitted. This value is omitted from the assignment if the Worker has not yet submitted results.

        • ApprovalTime (datetime) –

          If the Worker has submitted results and the Requester has approved the results, ApprovalTime is the date and time the Requester approved the results. This value is omitted from the assignment if the Requester has not yet approved the results.

        • RejectionTime (datetime) –

          If the Worker has submitted results and the Requester has rejected the results, RejectionTime is the date and time the Requester rejected the results.

        • Deadline (datetime) –

          The date and time of the deadline for the assignment. This value is derived from the deadline specification for the HIT and the date and time the Worker accepted the HIT.

        • Answer (string) –

          The Worker’s answers submitted for the HIT contained in a QuestionFormAnswers document, if the Worker provides an answer. If the Worker does not provide any answers, Answer may contain a QuestionFormAnswers document, or Answer may be empty.

        • RequesterFeedback (string) –

          The feedback string included with the call to the ApproveAssignment operation or the RejectAssignment operation, if the Requester approved or rejected the assignment and specified feedback.

Exceptions

  • MTurk.Client.exceptions.ServiceFault

  • MTurk.Client.exceptions.RequestError