Amazon MTurk PHP API.

The current PHP api for amazon doesn't work.

It's old and is no longer supported.

However they do have web services. So you can use their webservices with PHP if you know how to generate stub classes. Still there's lots of work involved in getting it all working/documented/tested for each of the request and responses they generate.

I've done some of that work here and have an example for creating a HIT with an image here.

http://www.bmvsoft.com/mturk/

With this example you still need to have a working amazon account setup and an amazon mturk account setup for either/or the sandbox etc.

Setup developer sandbox:

https://requester.mturk.com/developer/sandbox

Setup the main account

https://requester.mturk.com/developer

If you have questions/comment etc send emails to admin at bmvsoft.com.

Result for expiring and disposing a hit.

expireHit result:

{"OperationRequest":{"HTTPHeaders":null,"RequestId":"b3f6cd2e-408f-4703-8cea-375a8a6529b9","Arguments":null,"Errors":null},"ForceExpireHITResult":{"Request":{"IsValid":"True","CreateHITRequest":null,"RegisterHITTypeRequest":null,"DisposeHITRequest":null,"DisableHITRequest":null,"GetHITRequest":null,"GetAssignmentRequest":null,"GetReviewResultsForHITRequest":null,"GetReviewableHITsRequest":null,"GetHITsForQualificationTypeRequest":null,"GetQualificationsForQualificationTypeRequest":null,"SetHITAsReviewingRequest":null,"SearchHITsRequest":null,"ExtendHITRequest":null,"ForceExpireHITRequest":null,"ChangeHITTypeOfHITRequest":null,"CreateQualificationTypeRequest":null,"DisposeQualificationTypeRequest":null,"GrantQualificationRequest":null,"AssignQualificationRequest":null,"RevokeQualificationRequest":null,"GetQualificationRequestsRequest":null,"RejectQualificationRequestRequest":null,"GetQualificationTypeRequest":null,"SearchQualificationTypesRequest":null,"UpdateQualificationTypeRequest":null,"ApproveAssignmentRequest":null,"RejectAssignmentRequest":null,"ApproveRejectedAssignmentRequest":null,"GetAssignmentsForHITRequest":null,"GetFileUploadURLRequest":null,"GrantBonusRequest":null,"GetBonusPaymentsRequest":null,"GetAccountBalanceRequest":null,"NotifyWorkersRequest":null,"GetBlockedWorkersRequest":null,"BlockWorkerRequest":null,"UnblockWorkerRequest":null,"GetRequesterStatisticRequest":null,"GetRequesterWorkerStatisticRequest":null,"HelpRequest":null,"Errors":null}}}

disposeHit result:

{"OperationRequest":{"HTTPHeaders":null,"RequestId":"ae59a1df-8274-423a-b7d9-1648a941c692","Arguments":null,"Errors":null},"DisposeHITResult":{"Request":{"IsValid":"True","CreateHITRequest":null,"RegisterHITTypeRequest":null,"DisposeHITRequest":null,"DisableHITRequest":null,"GetHITRequest":null,"GetAssignmentRequest":null,"GetReviewResultsForHITRequest":null,"GetReviewableHITsRequest":null,"GetHITsForQualificationTypeRequest":null,"GetQualificationsForQualificationTypeRequest":null,"SetHITAsReviewingRequest":null,"SearchHITsRequest":null,"ExtendHITRequest":null,"ForceExpireHITRequest":null,"ChangeHITTypeOfHITRequest":null,"CreateQualificationTypeRequest":null,"DisposeQualificationTypeRequest":null,"GrantQualificationRequest":null,"AssignQualificationRequest":null,"RevokeQualificationRequest":null,"GetQualificationRequestsRequest":null,"RejectQualificationRequestRequest":null,"GetQualificationTypeRequest":null,"SearchQualificationTypesRequest":null,"UpdateQualificationTypeRequest":null,"ApproveAssignmentRequest":null,"RejectAssignmentRequest":null,"ApproveRejectedAssignmentRequest":null,"GetAssignmentsForHITRequest":null,"GetFileUploadURLRequest":null,"GrantBonusRequest":null,"GetBonusPaymentsRequest":null,"GetAccountBalanceRequest":null,"NotifyWorkersRequest":null,"GetBlockedWorkersRequest":null,"BlockWorkerRequest":null,"UnblockWorkerRequest":null,"GetRequesterStatisticRequest":null,"GetRequesterWorkerStatisticRequest":null,"HelpRequest":null,"Errors":null}}}

createHit result:

{"OperationRequest":{"HTTPHeaders":null,"RequestId":"76627cb0-f8fd-4055-bd63-676d104b7fab","Arguments":null,"Errors":null},"HIT":{"Request":{"IsValid":"True","CreateHITRequest":null,"RegisterHITTypeRequest":null,"DisposeHITRequest":null,"DisableHITRequest":null,"GetHITRequest":null,"GetAssignmentRequest":null,"GetReviewResultsForHITRequest":null,"GetReviewableHITsRequest":null,"GetHITsForQualificationTypeRequest":null,"GetQualificationsForQualificationTypeRequest":null,"SetHITAsReviewingRequest":null,"SearchHITsRequest":null,"ExtendHITRequest":null,"ForceExpireHITRequest":null,"ChangeHITTypeOfHITRequest":null,"CreateQualificationTypeRequest":null,"DisposeQualificationTypeRequest":null,"GrantQualificationRequest":null,"AssignQualificationRequest":null,"RevokeQualificationRequest":null,"GetQualificationRequestsRequest":null,"RejectQualificationRequestRequest":null,"GetQualificationTypeRequest":null,"SearchQualificationTypesRequest":null,"UpdateQualificationTypeRequest":null,"ApproveAssignmentRequest":null,"RejectAssignmentRequest":null,"ApproveRejectedAssignmentRequest":null,"GetAssignmentsForHITRequest":null,"GetFileUploadURLRequest":null,"GrantBonusRequest":null,"GetBonusPaymentsRequest":null,"GetAccountBalanceRequest":null,"NotifyWorkersRequest":null,"GetBlockedWorkersRequest":null,"BlockWorkerRequest":null,"UnblockWorkerRequest":null,"GetRequesterStatisticRequest":null,"GetRequesterWorkerStatisticRequest":null,"HelpRequest":null,"Errors":null},"HITId":"30EV7DWJTVBZ54TNJ0CNQ11PKENY6K","HITTypeId":"3WO7ZNC6SLM21ZP3ABRNIAG7WB2D8K","HITGroupId":null,"HITLayoutId":null,"CreationTime":null,"Title":null,"Description":null,"Question":null,"Keywords":null,"HITStatus":null,"MaxAssignments":null,"Reward":null,"AutoApprovalDelayInSeconds":null,"Expiration":null,"AssignmentDurationInSeconds":null,"RequesterAnnotation":null,"QualificationRequirement":null,"HITReviewStatus":null,"NumberOfAssignmentsPending":null,"NumberOfAssignmentsAvailable":null,"NumberOfAssignmentsCompleted":null}}