Can I get the Assignment ID from the Accept URL?

Discussion in 'General' started by sumrob, Jun 10, 2009.

  1. sumrob

    sumrob New Member

    Joined:
    Jun 10, 2009
    Messages:
    2
    Likes Received:
    0
    I have Task that forces users to open a link to our FORM on our server. I want to construct the Link using some client side javascript that I will embed right into the design layout. I got the JS working, now all I need to do is get the HIT ID and Assignment ID from the URL after the user clicks "Accept". Here are the URL params I see on that URL:

    https://www.mturk.com/mturk/accept
    ?hitId=YX1Z2T43NKFPXKY3JXAZ
    &prevHitSubmitted=false
    &prevRequester=atlanticbt
    &requesterId=A2ME5EMAU76MP5
    &prevReward=USD3.50
    &hitAutoAppDelayInSeconds=604800
    &groupId=CYN2V4C0RS5TQ8ZH2Z70
    &iteratorHitsLeft=
    &iteratorSearchSpec=
    &signature=biEW%2BQMTpgGTIZrSoVWDN7tzerQ%3D
    &/accept.x=44
    &/accept.y=13

    Does anyone know how I can get the Assisgnment ID from the URL, or if I can get at all
     
  2. ergo

    ergo User

    Joined:
    Jan 25, 2009
    Messages:
    358
    Likes Received:
    0
    Well, the official way to do this is to use the Mechanical Turk API for posting your HITs and then use ExternalQuestion, embedding your form in the HIT via an IFRAME. The assignment ID will be passed as a URL parameter to your embedded page. (http://docs.amazonwebservices.com/A...tml?ApiReference_ExternalQuestionArticle.html)


    Alternately if you prefer using requester.mturk.com to design your HITs, you can also access the assignment ID. The URL you were looking at has no bearing on your HIT. Your HIT is again displayed in an IFRAME, but in this case one hosted on Amazon's servers. Just parse document.location.href in your javascript to grab the parameter 'assignmentId', then pass it to your form however you planned to do that.
     
    #2 ergo, Jun 10, 2009
    Last edited by a moderator: Jun 10, 2009
  3. sumrob

    sumrob New Member

    Joined:
    Jun 10, 2009
    Messages:
    2
    Likes Received:
    0
  4. seaboardavenue

    Joined:
    Jan 16, 2013
    Messages:
    3,733
    Likes Received:
    0
    Already answered.
     

Share This Page