Git Product home page Git Product logo

api-mturk's People

Contributors

hendrikschneider avatar jose-barrios-hs avatar josebarrios avatar kgao avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

api-mturk's Issues

dont minify

why is this minified before being published? it makes stacktraces unusable

createHIT example

are there any examples of stuff going to createHIT? The reward and question parameters are undocumented

ApproveAssignments: Errors not handled properly

Hi,

I am using api-mturk in the nodegame-mturk module and I have a problem that the vorpal console crashes if there is an error such as:

"ApproveAssignment": RequestError - AWS.MechanicalTurk.InvalidAssignmentState. This operation can be called with a status of: null (1564062665570):

The following happens

ng-amt$ uploadResults /home/stefano/www/nodegame-mturk/node_modules/api-mturk/index.js:132 throw new Error(this.getErrorMessage(response)); ^ Error: RequestError - AWS.MechanicalTurk.InvalidAssignmentState. This operation can be called with a status of: Submitted (1564062609327): at IncomingMessage.res.on (/home/stefano/www/nodegame-mturk/node_modules/api-mturk/index.js:132:21) at IncomingMessage.emit (events.js:203:15) at endReadableNT (_stream_readable.js:1129:12) at process._tickCallback (internal/process/next_tick.js:63:19)

I am not sure why the reject callback is not called, I could fix by changing this line, but I am not sure it is the proper way to go about.

 } else {
     // throw new Error(this.getErrorMessage(response));
     if (reject) reject(this.getErrorMessage(response));
}

Created HIT is not displayed

Hi,

I used your example code to test the lib but it seems that my HIT is not really created. After I created the HIT, I get a positive feedback and also IDs but the HIT is not visible in my MT interface.

My mistake, your api works

cache wsdl file

pulling down 200kb every startup is slow and a waste of bandwidth. should either be cached or stored locally.

i saw the commit where you removed it locally and i think thats a really bad idea. if the module mturk-api isn't tied to any specific API version, then lets say one day amazon changes the data it returns and now your code breaks randomly in production because this module is always using the latest version no matter what

Error handling

When the API returns an error, the promise still goes through fine and the end-user is left diving into the object to check for an error

Example response object when an error occurs:

{
  "OperationRequest":{
    "RequestId":"9b35df27-371b-4e3b-8ef3-3d2de518352e"
  },
  "HIT":[
    {
      "Request":{
        "IsValid":"False",
        "Errors":{
          "Error":[
            {
              "Code":"AWS.InvalidEnumeratedParameter",
              "Message":"The value \"Illegal Text data found as child of: Reward\" you specified for enumeration is invalid. (1441703429839 s)",
              "Data":[
                {
                  "Key":"Parameter",
                  "Value":"enumeration"
                },
                {
                  "Key":"Value",
                  "Value":"Illegal Text data found as child of: Reward"
                }
              ]
            }
          ]
        }
      }
    }
  ]
}

CreateTime and Expiration dates

When creating a HIT using the 2014 API legacy support returns the wrong date parameter (always 1970-01-19T02:22:20.289+00:00). Instead, the 2014 should return the correct CreateTime and Expiration dates (e.g., 2019-07-21T14:22:20.289+00:00)

Error With Invalid AWS Aauthentication

Current API assume the access id / key setup correctly, when user use an invalid AWS authentication id or key, it throws the error

W20160406-11:11:55.969(-4)? (STDERR) TypeError: Cannot read property '0' of undefined
W20160406-11:11:55.969(-4)? (STDERR)     at ... \mturk-api\index.js:75:59    

would you consider to fix this? Thank you!

Error:The value is not valid for the parameter type. Expected values HITTEMPLATE.

I get this error

Error occurred Error: The value  is not valid for the parameter type. Expected values HITTEMPLATE.

when calling

mturkAPI.req('GetHITsForQualificationType',{ QualificationTypeId:options.mturk.HITTypeId }).then(function(results) {

                    return done(null, results);
                    
                }).catch((error)=> {
                    logger.error("Error occurred %s", error.toString());
                });

According to the GetHITsForQualificationType API Docs, parameters should be correct.

Replace SOAP with REST

Amazon is slowly deprecating SOAP in favor of REST. They've already done away with SOAP completely for EC2. It is critical that we start planning ahead for a potential SOAP deprecation in MTurk.

Currently, MTurk SOAP requests are not fully support other AWS services like IAM. This means that, because we use SOAP, users need to use their root keys in order to make MTurk requests using our API. When we migrate to REST root keys will still work, but they will no longer be the only option.

Please let me know your thoughts, comments or concerns.

Error occurred TypeError: Cannot read property 'sigBytes' of undefined

It happens when calling the GetHITsForQualificationType api:

mturkAPI.req('GetHITsForQualificationType',{ QualificationTypeId:HITTypeId }).then(function(results) {
                    
                    self.logger.debug("loaded HITS %d", results.length);
                   

                    return done(null, results);
                    
                }).catch((error)=> {
                    self.logger.error("Error occurred %s", error.toString());
                });

Node cannot find module when deploying to Heroku

Thanks for the great module!
I am importing your module in my program using var mturkApi = require('mturk-api') and it all works find on my local machine. When I deploy my app to heroku, npm throws an error 'Error: cannot find module 'mturk-api'
Any idea what is going on here?
Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.