Amazon Mechanical Turk
API Reference (API Version 2012-03-25)
« PreviousNext »
View the PDF for this guide.Go to the AWS Discussion Forum for this product.Did this page help you?  Yes | No |  Tell us about it...

GetAssignment

Description

The GetAssignment operation retrieves an assignment using the assignment's ID. Requesters can only retrieve their own assignments, and only assignments whose related HIT has not been disposed.

Request Parameters

The GetAssignment operation accepts parameters common to all operations. Some common parameters are required. For more information, see Common Parameters.

The following parameters are specific to the GetAssignment operation:

NameDescriptionRequired

Operation

The name of the operation.

Type: String

Valid Values: GetAssignment

Default: None

Yes

AssignmentId

The ID of the assignment that is being requested.

Type: String

Default: None.

Yes

Response Elements

A successful request for the GetAssignment operation has a GetAssignmentResult element in the response.

The GetAssignmentResult element contains the following elements:

NameDescription

Request

This element is present only if the Request ResponseGroup is specified.

Assignment

The assignment. The response includes one Assignment element.

Type: An Assignment data structure

HIT

The HIT associated with this assignment. The response includes one HIT element.

Type: A HIT data structure

Examples

The following example shows how to use the GetAssignment operation.

Sample Request

The following example retrieves an assignment using the assignment's ID.

https://mechanicalturk.amazonaws.com/?Service=AWSMechanicalTurkRequester
&AWSAccessKeyId=[the Requester's Access Key ID]
&Version=2012-03-25
&Operation=GetAssignment
&Signature=[signature for this request]
&Timestamp=[your system's local time]
&AssignmentId=GYFTRHZ5J3DZREY48WNZE38ZR9RR1ZPMXGWE7WE0          

Sample Response

The following is an example response.

<GetAssignmentResult>
  <Request>
    <IsValid>True</IsValid>
  </Request>
  <Assignment>
    <AssignmentId>GYFTRHZ5J3DZREY48WNZE38ZR9RR1ZPMXGWE7WE0</AssignmentId>
    <WorkerId>AD20WXZZP9XXK</WorkerId>
    <HITId>GYFTRHZ5J3DZREY48WNZ</HITId>
    <AssignmentStatus>Approved</AssignmentStatus>
    <AutoApprovalTime>2012-08-12T19:21:54Z</AutoApprovalTime>
    <AcceptTime>2012-07-13T19:21:40Z</AcceptTime>
    <SubmitTime>2012-07-13T19:21:54Z</SubmitTime>
    <ApprovalTime>2012-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>
  <HIT>
    <HITId>GYFTRHZ5J3DZREY48WNZ</HITId>
    <HITTypeId>NYVZTQ1QVKJZXCYZCZVZ</HITTypeId>
    <CreationTime>2012-07-07T00:56:40Z</CreationTime>
    <Title>Location</Title>
    <Description>Answer this Question</Description>
    <Question>
      <QuestionForm xmlns="http://mechanicalturk.amazonaws.com/AWSMechanicalTurkDataSchemas/2005-10-01/QuestionForm.xsd">
        <Question>
          <QuestionIdentifier>Question100</QuestionIdentifier>
          <DisplayName>My Question</DisplayName>
          <IsRequired>true</IsRequired>
          <QuestionContent>
            <Binary>
              <MimeType>
                <Type>image</Type>
                <SubType>gif</SubType>
              </MimeType>
              <DataURL>http://tictactoe.amazon.com/game/01523/board.gif</DataURL>
              <AltText>The game board, with "X" to move.</AltText>
            </Binary>
          </QuestionContent>
          <AnswerSpecification><FreeTextAnswer/></AnswerSpecification>
        </Question> 
      </QuestionForm>
    </Question>
    <HITStatus>Assignable</HITStatus>
    <MaxAssignments>1</MaxAssignments>
    <Reward>
      <Amount>5.00</Amount>
      <CurrencyCode>USD</CurrencyCode>
      <FormattedPrice>$5.00</FormattedPrice>
    </Reward>
    <AutoApprovalDelayInSeconds>2592000</AutoApprovalDelayInSeconds>
    <Expiration>2012-07-14T00:56:40Z</Expiration>
    <AssignmentDurationInSeconds>30</AssignmentDurationInSeconds>
    <NumberOfSimilarHITs>1</NumberOfSimilarHITs>
    <HITReviewStatus>NotReviewed</HITReviewStatus>
  </HIT>
</GetAssignment>