Skip to content

get_hit

get_hit(
    hit_id: EntityId, *, config_overrides: Optional[MTurkClientConfig] = None
) -> GetHITResponse

The GetHIT operation retrieves the details of the specified HIT.

Parameters:

  • hit_id (EntityId) –

    The ID of the HIT to be retrieved.

Raises:

  • RequestError –

    Your request is invalid.

  • ServiceFault –

    Amazon Mechanical Turk is temporarily unable to process your request. Try your call again.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_mturk/_services/m_turk.py
def get_hit(
    self,
    hit_id: "capo_mturk.types.entity_id.EntityId",
    *,
    config_overrides: Optional[MTurkClientConfig] = None,
) -> "capo_mturk.types.get_hit_response.GetHITResponse":
    """<p> The <code>GetHIT</code> operation retrieves the details of the specified HIT. </p>

    Args:
        hit_id: <p>The ID of the HIT to be retrieved.</p>

    Raises:
        capo_mturk.errors.request_error.RequestError: <p>Your request is invalid.</p>
        capo_mturk.errors.service_fault.ServiceFault: <p>Amazon Mechanical Turk is temporarily unable to process your request. Try your call again.</p>
        capo_mturk.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_mturk.types.get_hit_request.GetHITRequest]",
    ) -> OperationResponse["capo_mturk.types.get_hit_response.GetHITResponse"]:
        import capo_mturk._operations.m_turk_requester_service_v20170117.get_hit

        output, http_response = (
            capo_mturk._operations.m_turk_requester_service_v20170117.get_hit.get_hit(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("GetHIT")
    )
    input_: capo_mturk.types.get_hit_request.GetHITRequest = {"hit_id": hit_id}

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output