New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

nodegame-api-mturk

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nodegame-api-mturk

JS implementation of Amazon Mechanical Turk (mturk) API (initially forked from josebarrios api-mturk implementation)

  • 1.3.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3
decreased by-92.31%
Maintainers
1
Weekly downloads
 
Created
Source

[![Downloads][download-badge]][npm-url]

Handles low level API calls to the AWS services.

Use nodegame-mturk for your operations.

Initially, this is was a fork api-mturk.

### Basic usage
```js
var mturk = require('api-mturk');

var config = {
    access : 'ACCESS_KEY_GOES_HERE',
    secret : 'SECRET_KEY_GOES_HERE',
    sandbox: true
}


mturk.createClient(config).then(function(api){


  api.req('GetAccountBalance').then(function(res){
    //Do something
  }).catch(console.error);


  //Example operation, with params
  api.req('SearchHITs', { PageSize: 100 }).then(function(res){
     //Do something
  }).catch(console.error)

}).catch(console.error);


Create HIT Example


//Import an XML file. You can use one of our examples in the templates folder *
fs.readFile('./templates/HTMLQuestion.xml', 'utf8', function(err, unescapedXML){
  if(err){console.error(err);return}

  //HIT options
  var params = {
    Title: "Create HIT Example",
    Description: "An example of how to create a HIT",
    Question: _.escape(unescapedXML),//IMPORTANT: XML NEEDS TO BE ESCAPED!
    AssignmentDurationInSeconds: 180, // Allow 3 minutes to answer
    AutoApprovalDelayInSeconds: 86400 * 1, // 1 day auto approve
    MaxAssignments: 100, // 100 worker responses
    LifetimeInSeconds: 86400 * 3, // Expire in 3 days
    Reward: {CurrencyCode:'USD', Amount:0.50}
  };

  api.req('CreateHIT', params).then(function(res){
    //DO SOMETHING
  }).catch(console.error);

})

* To see the all available Question templates, go to our templates folder

2014 API legacy operations

OperationRequired ParametersUnit 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 }
GetAccountBalanceNone
GetAssignment{ AssignmentId:String }
GetAssignmentsForHIT{ HITId:String }
GetBlockedWorkersNone
GetBonusPayments{ HITId:String } OR { AssignmentId:String }
GetFileUploadURL{ AssignmentId:String, QuestionIdentifier:String }
GetHIT{ HITId:String }
GetHITsForQualificationType{ QualificationTypeId:String }
GetQualificationsForQualificationType{ QualificationTypeId:String }
GetQualificationRequestsNone
GetQualificationScore{ QualificationTypeId:String, SubjectId:String}
GetQualificationType{ QualificationTypeId:String }
GetRequesterStatistic{ Statistic:String, TimePeriod:String }
GetRequesterWorkerStatistic{Statistic:String, WorkerId:String, TimePeriod:String }
GetReviewableHITsNone
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 }
SearchHITsNone
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

Keywords

FAQs

Package last updated on 28 Dec 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc