code: def get_ad_via_hitid(hit_id):
      ''' Get ad via HIT id '''
      username = CONFIG.get('psiTurk Access', 'psiturk_access_key_id')
      password = CONFIG.get('psiTurk Access', 'psiturk_secret_access_id')
      try:
          req = requests.get('https://api.psiturk.org/api/ad/lookup/' + hit_id,
                             auth=(username, password))
      except:
          raise ExperimentError('api_server_not_reachable')
      else:
          if req.status_code == 200:
              return req.json()['ad_id']
          else:
              return "errorf get_ad_via_hitid(hit_id):
      ''' Get ad via HIT id '''
      username = CONFIG.get('psiTurk Access', 'psiturk_access_key_id')
      password = CONFIG.get('psiTurk Access', 'psiturk_secret_access_id')
      try:
          req = requests.get('https://api.psiturk.org/api/ad/lookup/' + hit_id,
                             auth=(username, password))
      except:
          raise ExperimentError('api_server_not_reachable')
      else:
          if req.status_code == 200:
              return req.json()['ad_id']
          else:
              return "error"
docs: Get ad via HIT id