我正在试着做这样的请求:
https://mechanicalturk.amazonaws.com/?Service=AWSMechanicalTurkRequester
&AWSAccessKeyId=[the Requester's Access Key ID]
&Operation=SetHITTypeNotification
&Signature=[signature for this request]
&Timestamp=[your system's local time]
&HITTypeId=T100CN9P324W00EXAMPLE
&Notification.1.Destination=janedoe@example.com
&Notification.1.Transport=Email
&Notification.1.Version=2006-05-05
&Notification.1.EventType=AssignmentSubmitted基于这里的文档:http://docs.aws.amazon.com/AWSMechTurk/latest/AWSMturkAPI/ApiReference_SetHITTypeNotificationOperation.html
下面是我的代码:
RTurk.SetHITTypeNotification(:hit_type_id => "3M36IJVRR974ABAC76WQ0TCVKX9SIA", :notification => { :destination => "https://sqs.us-east-1.amazonaws.com/971351813114/MechanicalTurk", :transport => "SQS", :version => "2006-05-05", :event_type => "assignment_accepted" }, :active => true)下面是我看到的错误:
NoMethodError: undefined method `to_param_hash' for #<Hash:0x007ffe1ed82858>有人知道to_param_hash错误的含义或如何解决它吗?
发布于 2016-04-07 09:51:00
在这个问题上花了几个小时。在这里回答,以防对其他有同样情况的人有所帮助。事实证明,我需要创建一个Notification对象,当您查看如何在其他上下文中使用RTurk中的通知时,这很有意义。下面是一个有效的代码片段:
n = RTurk::Notification.new("https://sqs.us-east-1.amazonaws.com/971351813114/MechanicalTurk", "SQS", "2006-05-05", "AssignmentAccepted")
a = RTurk.SetHITTypeNotification(:hit_type_id => "3M36IJVRR974ABAC76WQ0TCVKX9SIA", :notification => n, :active => true)
t = RTurk.SendTestEventNotification(:notification => n, :test_event_type => "AssignmentAccepted")希望这对其他有同样情况的人有所帮助!
https://stackoverflow.com/questions/36465321
复制相似问题