How to use SetHITTypeNotification in Amazon Mechanical Turk using the Perl SDK?

Has anyone used the createHITType function in the Perl Amazon Mechanical Turk SDK to add notification properties to their HIT?

I managed to get all this to work. I can capture the balance from both my sandbox and the live system. I have successfully created new images using various methods in the samples directory, but I need to enable SetHITTypeNotification, passing properties that tell Amazon to notify me by email when someone receives / sends hits.

I checked the AWS documentation and the rough scheme would be like this:

 <Notification>  
  <Destination>me@email.com</Destination>
  <Transport>Email</Transport>  
  <Version>2006-10-31</Version>  
  <EventType>AssignmentAccepted</EventType>
  <EventType>AssignmentSubmitted</EventType>
 </Notification>

I did a few grep'ing through various modules that look for notifications, and stumbled upon the BulkSupport.pm module, which seems to refer to notifications contained as a hash in the properties object passed to the createHITType function.

I also think that it takes them from the properties file, but I specifically studied Perl to use mturk with another project, so now I'm at a dead end to figure out what to do. I'm also tired of all the modules, but there is a complete lack of documentation on the implementation of notifications from what I can find.

+3
source share
1 answer

I found a solution in perl without an XML structure:

my $mturk2 = Net::Amazon::MechanicalTurk->new(serviceUrl=>"prod");
my $result2 = $mturk2->SetHITTypeNotification(
                     HITTypeId    => 'EXAMPLE00000000000EXAMPLE00000',
                     Notification => {
                         Transport => 'Email',
                         Destination => 'me@email.com',
                         EventType => 'AssignmentSubmitted',
                         Version => '2006-05-05'
                    },
                    Active       => 'true'
);
print $result->toString;

using the module: Net :: Amazon :: MechanicalTurk

+1
source

Source: https://habr.com/ru/post/1766113/


All Articles