Send a File or URL
Reference documentation on sending files or URLs for processing using Mindee client libraries.
This is reference documentation.
Code samples shown are only examples, and will not work as-is. You'll need to copy-paste and modify according to your requirements.
Looking for a quick TL;DR, or full code samples?
Take a look at the Quick Start page.
Ask our documentation AI to write code samples for you: You can also use the "ask" button at the top of any page in the documentation.
Requirements
You'll need to have your Mindee client configured correctly as described in the Configure the Client section.
Both the Client and the Product 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.
The contents of a URL cannot be manipulated locally. You'll need to download it to the local machine if you wish to adjust the file in any way before sending.
Load for Sending
There's no difference between sending a file or an URL, both are considered valid Input Sources.
Use a File
You'll need a Local Input Source as described in the Load and Adjust a File section.
Use an URL
You'll need a URL Input Source as described in the Load an URL section.
Send with Polling
Send a document using polling, this is the simplest way to get started.
The client library will POST the request for you, and then automatically poll the API.
Polling Configuration
When polling you really only need to set the model_id .
You can also set the various polling parameters. However, we do not recommend setting this option unless you are encountering timeout problems.
When polling you really only need to set the modelId .
You can also set the various polling parameters. However, we do not recommend setting this option unless you are encountering timeout problems.
When polling you really only need to set the modelId .
You can also set the various polling parameters. However, we do not recommend setting this option unless you are encountering timeout problems.
When polling you really only need to set the model_id .
You can also set the various polling parameters. However, we do not recommend setting this option unless you are encountering timeout problems.
When polling you really only need to set the modelId .
You can also set the various polling parameters. However, we do not recommend setting this option unless you are encountering timeout problems.
When polling you really only need to set the modelId .
You can also set the various polling parameters. However, we do not recommend setting this option unless you are encountering timeout problems.
Polling Method Call
You'll need a valid input source, one of:
a local source created in Load and Adjust a File
a remote source created in Load an URL
The mindee_client, created in Configure the Client.
Use the enqueue_and_get_result method.
The mindeeClient, created in Configure the Client.
Use the enqueueAndGetResult method:
The $mindeeClient , created in Configure the Client.
Use the enqueueAndGetInference method:
The mindee_client, created in Configure the Client.
Use the enqueue_and_get_inference method.
The mindeeClient, created in Configure the Client.
Use the enqueueAndGetInference method:
The mindeeClient, created in Configure the Client.
Use the EnqueueAndGetInferenceAsync method:
Send with Webhook
Send a document using webhooks, this is recommended for production use, in particular for high volume.
You'll need a valid input source, one of:
a local source created in Load and Adjust a File
a remote source created in Load an URL
Webhook Configuration
The client library will POST the request to your Web server, as configured by your webhook endpoint.
For more information on webhooks, take a look at the Webhook Results page.
When using a webhook, you'll need to set the model ID and the webhook ID(s) to use.
Webhook Method Call
You can specify any number of webhook endpoint IDs, each will be sent the payload.
The mindee_client, created in Initialize the Mindee Client.
Use the enqueue_inference method:
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 sent as well.
The mindeeClient, created in Initialize the Mindee Client.
Use the enqueue method:
Note: You can use both methods!
First, make sure you've added a webhook ID to the productParams object.
Then, call enqueueAndGetResult and await the promise.
You'll get the response via polling and webhooks will be sent as well.
The $mindeeClient, created in Initialize the Mindee Client.
Use the enqueueInference method:
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 sent as well.
The mindee_client, created in Initialize the Mindee Client.
Use the enqueue_inference method:
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 sent as well.
The mindeeClient, created in Initialize the Mindee Client.
Use the enqueueInference method:
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 sent as well.
The mindeeClient, created in Initialize the Mindee Client.
Use EnqueueInferenceAsync method:
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 sent as well.
Get Processing Status
Accessing processing information is done using the Job object and related method calls.
If you are using webhooks, we highly recommend storing the job's ID so you can retrieve this information for debugging purposes.
You can access:
overall processing status
detailed errors, if any
status for each webhook sent
creation and completion times
etc
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 Response section for details on the next step.
Last updated
Was this helpful?

