General documentation / cheat sheets for various languages and services

Amazon Mechanical Turk

Operations

I have pretty printed and removed the <?xml version="1.0"?> from all success / failure examples below.

ApproveAssignment

Success:

<ApproveAssignmentResponse>
  <OperationRequest>
    <RequestId>bc6cf077-5d66-4f74-f943-14ea8a57b95b</RequestId>
  </OperationRequest>
  <ApproveAssignmentResult>
    <Request><IsValid>True</IsValid></Request>
  </ApproveAssignmentResult>
</ApproveAssignmentResponse>

Failure:

<ApproveAssignmentResponse>
  <OperationRequest>
    <RequestId>41447390-1b93-bc99-603f-c380b31306b3</RequestId>
  </OperationRequest>
  <ApproveAssignmentResult>
    <Request>
      <IsValid>False</IsValid>
      <Errors>
        <Error>
          <Code>
            AWS.MechanicalTurk.InvalidAssignmentState
          </Code>
          <Message>
            This operation can be called with a status of: Submitted (1432965840161)
          </Message>
          <Data>
            <Key>ExpectedStates</Key>
            <Value>Submitted</Value>
          </Data>
          <Data>
            <Key>CurrentState</Key>
            <Value>Approved</Value>
          </Data>
          <Data>
            <Key>ExpectedStates</Key>
            <Value>Submitted</Value>
          </Data>
        </Error>
      </Errors>
    </Request>
  </ApproveAssignmentResult>
</ApproveAssignmentResponse>

CreateHIT

Success:

<CreateHITResponse>
  <OperationRequest>
    <RequestId>3f92bc3d-07f8-40db-2e60-f8b21bf5f2f0</RequestId>
  </OperationRequest>
  <HIT>
    <Request><IsValid>True</IsValid></Request>
    <HITId>3WHORRWKX9ZSGPJ91RCSHNS30HQYV7</HITId>
    <HITTypeId>3J7M3LFX1852SDL4672AKD88EC7JW1</HITTypeId>
  </HIT>
</CreateHITResponse>

CreateQualificationType

Success:

<CreateQualificationTypeResponse>
  <OperationRequest>
    <RequestId>5103d10b-0aad-e50a-a6a8-b18124be8d11</RequestId>
  </OperationRequest>
  <QualificationType>
    <Request><IsValid>True</IsValid></Request>
    <QualificationTypeId>38Q5TG7DC0WTHBC9RKV0Z4LN8YAQ40</QualificationTypeId>
    <CreationTime>2015-07-09T00:39:15Z</CreationTime>
    <Name>Test qualification 1</Name>
    <Description>My first qualification type (temporary)</Description>
    <Keywords>test,autogranted</Keywords>
    <QualificationTypeStatus>Active</QualificationTypeStatus>
    <RetryDelayInSeconds>1800</RetryDelayInSeconds>
    <AutoGranted>1</AutoGranted>
    <AutoGrantedValue>1</AutoGrantedValue>
  </QualificationType>
</CreateQualificationTypeResponse>

Failure:

<CreateQualificationTypeResponse>
  <OperationRequest>
    <RequestId>a409ccd6-8623-49cd-6868-1888fd73e6ce</RequestId>
  </OperationRequest>
  <QualificationType>
    <Request>
      <IsValid>False</IsValid>
      <Errors>
        <Error>
          <Code>AWS.MechanicalTurk.QualificationTypeAlreadyExists</Code>
          <Message>
            You have already created a QualificationType with this name. A QualificationType's name must be unique among all of the QualificationTypes created by the same user. (1436761963958)
          </Message>
          <Data>
            <Key>QualificationTypeId</Key>
            <Value>38Q5TG7DC0WTHBC9RKV0Z4LN8YAQ40</Value>
          </Data>
          <Data>
            <Key>QualificationTypeId</Key>
            <Value>38Q5TG7DC0WTHBC9RKV0Z4LN8YAQ40</Value>
          </Data>
        </Error>
      </Errors>
    </Request>
  </QualificationType>
</CreateQualificationTypeResponse>

DisposeQualificationType

Success:

<DisposeQualificationTypeResponse>
  <OperationRequest>
    <RequestId>c973f145-ca3b-7417-39a9-b28154b42f7e</RequestId>
  </OperationRequest>
  <DisposeQualificationTypeResult>
    <Request>
      <IsValid>True</IsValid>
    </Request>
  </DisposeQualificationTypeResult>
</DisposeQualificationTypeResponse>

Failure:

<DisposeQualificationTypeResponse>
  <OperationRequest>
    <RequestId>4debb56c-294a-2a33-a3e1-fadb9fd3d651</RequestId>
  </OperationRequest>
  <DisposeQualificationTypeResult>
    <Request>
      <IsValid>False</IsValid>
      <Errors>
        <Error>
          <Code>AWS.MechanicalTurk.InvalidQualificationTypeState</Code>
          <Message>
            This operation can be called with a status of: Active,Inactive (1433596333756)
          </Message>
          <Data>
            <Key>QualificationTypeId</Key>
            <Value>3ISAMW410AS3H0PXAB30C72RWEHCQJ</Value>
          </Data>
          <Data>
            <Key>CurrentState</Key>
            <Value>Disposing</Value>
          </Data>
          <Data>
            <Key>ExpectedStates</Key>
            <Value>Active,Inactive</Value>
          </Data>
          <Data>
            <Key>ExpectedStates</Key>
            <Value>Active,Inactive</Value>
          </Data>
          <Data>
            <Key>QualificationTypeId</Key>
            <Value>3ISAMW410AS3H0PXAB30C72RWEHCQJ</Value>
          </Data>
        </Error>
      </Errors>
    </Request>
  </DisposeQualificationTypeResult>
</DisposeQualificationTypeResponse>

GetAccountBalance

Success:

<GetAccountBalanceResponse>
  <OperationRequest>
    <RequestId>3dfd11c8-244b-bc5b-f788-701b26b114a3</RequestId>
  </OperationRequest>
  <GetAccountBalanceResult>
    <Request><IsValid>True</IsValid></Request>
    <AvailableBalance>
      <Amount>356.490</Amount>
      <CurrencyCode>USD</CurrencyCode>
      <FormattedPrice>$356.49</FormattedPrice>
    </AvailableBalance>
  </GetAccountBalanceResult>
</GetAccountBalanceResponse>

GetQualificationsForQualificationType

Success:

<GetQualificationsForQualificationTypeResponse>
  <OperationRequest>
    <RequestId>685fb2c4-6058-e704-c9fb-4fda448d34dc</RequestId>
  </OperationRequest>
  <GetQualificationsForQualificationTypeResult>
    <Request><IsValid>True</IsValid></Request>
    <NumResults>20</NumResults>
    <TotalNumResults>20</TotalNumResults>
    <PageNumber>1</PageNumber>
    <Qualification>
      <QualificationTypeId>369ZZFP90OYIK697277WBGQQMK754X</QualificationTypeId>
      <SubjectId>AP3WTN0J7ZAUNG</SubjectId>
      <GrantTime>2015-07-08T16:47:02.000-07:00</GrantTime>
      <IntegerValue>1</IntegerValue>
      <Status>Granted</Status>
    </Qualification>
    <Qualification>
      <QualificationTypeId>369ZZFP90OYIK697277WBGQQMK754X</QualificationTypeId>
      <SubjectId>AFZF7E6VRDTXUN</SubjectId>
      <GrantTime>2015-07-08T16:51:50.000-07:00</GrantTime>
      <IntegerValue>1</IntegerValue>
      <Status>Granted</Status>
    </Qualification>
  </GetQualificationsForQualificationTypeResult>
</GetQualificationsForQualificationTypeResponse>