Install
npm install mturk-api
Basic usage
var mturk = require('mturk-api');
var config = {
access : 'ACCESS_KEY_GOES_HERE',
secret : 'SECRET_KEY_GOES_HERE',
sandbox: true
}
mturk.connect(config).then(function(api){
//Example operation, no params
api.req('GetAccountBalance').then(function(response){
//Do something
});
//Example operation, with params
api.req('SearchHITs', { PageSize: 100 }).then(function(response){
//Do something
});
}).catch(console.error);
Supported API Operations
Operation | Required Parameters | Unit test |
---|---|---|
ApproveAssignment | { AssignmentId:String } | |
ApproveRejectedAssignment | { AssignmentId:String } | |
AssignQualification | { QualificationTypeId:String, WorkerId:String } | ✓ |
BlockWorker | { WorkerId:String, Reason:String } | ✓ |
ChangeHITTypeOfHIT | { HITId:String, HITTypeId:String} | |
CreateHIT | { Title:String, Description:String, AssignmentDurationInSeconds:Number, LifetimeInSeconds:Number } OR {HITTypeId:String, LifetimeInSeconds:Number } | |
CreateQualificationType | { Name:String, Description:String, QualificationTypeStatus:String } | |
DisableHIT | { HITId:String } | |
DisposeHIT | { HitId:String } | |
DisposeQualificationType | {QualificationTypeId:String} | |
ExtendHIT | { HitId:String } | |
ForceExpireHIT | { HitId:String } | ✓ |
GetAccountBalance | None | ✓ |
GetAssignment | { AssignmentId:String } | |
GetAssignmentsForHIT | { HITId:String } | |
GetBlockedWorkers | None | ✓ |
GetBonusPayments | { HITId:String } OR { AssignmentId:String } | |
GetFileUploadURL | { AssignmentId:String, QuestionIdentifier:String } | |
GetHIT | { HITId:String } | ✓ |
GetHITsForQualificationType | { QualificationTypeId:String } | |
GetQualificationsForQualificationType | { QualificationTypeId:String } | |
GetQualificationRequests | None | |
GetQualificationScore | { QualificationTypeId:String, SubjectId:String} | |
GetQualificationType | { QualificationTypeId:String } | |
GetRequesterStatistic | { Statistic:String, TimePeriod:String } | |
GetRequesterWorkerStatistic | {Statistic:String, WorkerId:String, TimePeriod:String } | |
GetReviewableHITs | None | |
GetReviewResultsForHIT | { HITId:String } | |
GrantBonus | { WorkerId:String, AssignmentId:String, BonusAmount:Object, Reason:String } | |
GrantQualification | { QualificationRequestId:String } | |
NotifyWorkers | { Subject:String, MessageText:String, WorkerId:Array} | |
RegisterHITType | { Title:String, Description:String, Reward:Object, AssignmentDurationInSeconds:Number } | |
RejectAssignment | { AssignmentId:String } | |
RejectQualificationRequest | { QualificationRequestId:String } | |
RevokeQualification | { Subject:String, QualificationTypeId:String, Reason:String } | |
SearchHITs | None | ✓ |
SearchQualificationTypes | { MustBeRequestable:Boolean } | |
SendTestEventNotification | { Notification:Object, TestEventType:Object } | ✓ |
SetHITAsReviewing | { HITId:String } | |
SetHITTypeNotification | { HITTypeId:String, Notification:Object, } | |
UnblockWorker | { WorkerId:String, } | ✓ |
UpdateQualificationScore | { QualificationTypeId:String, SubjectId:String, IntegerValue:Number } | |
UpdateQualificationType | { QualificationTypeId:String } |
License
MIT © Jose Barrios
Banner derived from Cosmin Cuciureanu's BrainUP