Use the search bar above to ask our documentation AI to write code samples for you.
Requirements
You'll need to have your Mindee client configured correctly as described in the Configure the Client page.
Both the Client and the Inference Parameters are required.
Overview
You can send either a local file or an URL to Mindee servers for processing.
The source has no impact on server-side processing nor on the result.
A local file can be manipulated and adjusted before sending, as described in the Adjust the Source File section.
An URL cannot be manipulated locally for obvious reasons, you'll need to download it to the local machine if you wish to adjust the file in any way before sending.
For polling, use the enqueue_and_get_inference method.
response = mindee_client.enqueue_and_get_inference(
input_source, inference_params
)
# To easily test which data was extracted,
# simply print an RST representation of the inference
print(response.inference)
response = mindee_client.enqueue_inference(
input_source, inference_params
)
# You should save the job ID for your records
print(response.job.id)
# If you set an `alias`, you can verify it was taken into account
print(response.job.alias)
Note: You can use both methods!
First, make sure you've added a webhook ID to the InferenceParameters instance.
Then, call enqueue_and_get_inference .
You'll get the response via polling and webhooks will be used as well.
For polling, use the enqueueAndGetInference method:
const response = mindeeClient.enqueueAndGetInference(
inputSource,
inferenceParams
);
// Handle the response Promise
response.then((resp) => {
// To easily test which data was extracted,
// simply print an RST representation of the inference
console.log(resp.inference.toString());
});
const response = mindeeClient.enqueueInference(
inputSource,
inferenceParams
);
// Handle the response Promise
response.then((resp) => {
// You should save the job ID for your records
console.log(resp.job.id);
// If you set an `alias`, you can verify it was taken into account
console.log(resp.job.alias);
});
Note: You can use both methods!
First, make sure you've added a webhook ID to the InferenceParameters instance.
Then, call enqueueAndGetInference and handle the promise.
You'll get the response via polling and webhooks will be used as well.
For polling, use the enqueueAndGetInference method:
$response = $mindeeClient->enqueueAndGetInference(
$inputSource,
$inferenceParams
);
// To easily test which data was extracted,
// simply print an RST representation of the inference
echo strval($response->inference);
$response = $mindeeClient->enqueueInference(
$inputSource,
$inferenceParams
);
// You should save the job ID for your records
echo strval($response->job->id);
// If you set an `alias`, you can verify it was taken into account
echo strval($response->job->alias);
Note: You can also use both methods!
First, make sure you've added a webhook ID to the InferenceParameters instance.
Then, call enqueueAndGetInferenceAsync.
You'll get the response via polling and webhooks will be used as well.
InferenceResponse response = mindeeClient.enqueueAndGetInference(
inputSource, inferenceParams
);
// To easily test which data was extracted,
// simply print an RST representation of the inference
System.out.println(response.getInference().toString());
For webhooks, use the enqueueInference method:
JobResponse response = mindeeClient.enqueueInference(
inputSource, inferenceParams
);
// You should save the job ID for your records
System.out.println(response.getJob().getId());
// If you set an `alias`, you can verify it was taken into account
System.out.println(response.getJob().getAlias());
Note: You can use both methods!
First, make sure you've added a webhook ID to the InferenceParameters instance.
Then, call enqueueAndGetInference and handle the promise.
You'll get the response via polling and webhooks will be used as well.
var response = await mindeeClient.EnqueueAndGetInferenceAsync(
inputSource, inferenceParams);
// To easily test which data was extracted,
// simply print an RST representation of the inference
System.Console.WriteLine(response.Inference.ToString());
For webhooks, use EnqueueInferenceAsync method:
var response = mindeeClient.EnqueueInferenceAsync(
inputSource, inferenceParams
);
// You should save the job ID for your records
System.Console.WriteLine(response.Job.Id);
// If you set an `alias`, you can verify it was taken into account
System.Console.WriteLine(response.Job.Alias);
Note: You can also use both methods!
First, make sure you've added a webhook ID to the InferenceParameters instance.
Then, call EnqueueAndGetInferenceAsync.
You'll get the response via polling and webhooks will be used as well.
Process the Result
Now that your file or URL has been handled by the Mindee servers, you'll want to process the results and use them in your application.
Head on over to the Process the Result page for details on the next step.