(files.extractTables)
Extract tables from files
- sync - Extract Tables - Sync
- start - Extract Tables - Async Start
- result - Extract Tables - Async Result
Extracts tables from a file. Supported file types are image, pdf (more coming soon!). It accepts the file.
import { IntunedClient } from "@intuned/client";
const intunedClient = new IntunedClient({
apiKey: "<YOUR_API_KEY_HERE>",
workspaceId: "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee",
});
async function run() {
const result = await intunedClient.files.extractTables.sync({
type: "pdf",
source: {
type: "url",
data: "http://unconscious-margin.name",
},
});
// Handle the result
console.log(result)
}
run();
The standalone function version of this method:
import { IntunedClientCore } from "@intuned/client/core.js";
import { filesExtractTablesSync } from "@intuned/client/funcs/filesExtractTablesSync.js";
// Use `IntunedClientCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const intunedClient = new IntunedClientCore({
apiKey: "<YOUR_API_KEY_HERE>",
workspaceId: "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee",
});
async function run() {
const res = await filesExtractTablesSync(intunedClient, {
type: "image",
source: {
type: "base64",
data: "<value>",
},
});
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result)
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
file |
components.FileT | ✔️ | N/A |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body , are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<components.TableExtractionSyncResponse>
Error Object | Status Code | Content Type |
---|---|---|
errors.ApiErrorInvalidInput | 400 | application/json |
errors.ApiErrorUnauthorized | 401 | application/json |
errors.SDKError | 4xx-5xx | / |
Starts an asynchronous operation to extract tables from a file. Supported file types are image, pdf (more coming soon!). This methods accepts the file. The API responds with an ID to track the operation status and retrieve the result.
import { IntunedClient } from "@intuned/client";
const intunedClient = new IntunedClient({
apiKey: "<YOUR_API_KEY_HERE>",
workspaceId: "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee",
});
async function run() {
const result = await intunedClient.files.extractTables.start({
type: "image",
source: {
type: "base64",
data: "<value>",
},
});
// Handle the result
console.log(result)
}
run();
The standalone function version of this method:
import { IntunedClientCore } from "@intuned/client/core.js";
import { filesExtractTablesStart } from "@intuned/client/funcs/filesExtractTablesStart.js";
// Use `IntunedClientCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const intunedClient = new IntunedClientCore({
apiKey: "<YOUR_API_KEY_HERE>",
workspaceId: "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee",
});
async function run() {
const res = await filesExtractTablesStart(intunedClient, {
type: "pdf",
source: {
type: "base64",
data: "<value>",
},
});
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result)
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
file |
components.FileT | ✔️ | N/A |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body , are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<components.AsyncFilePendingResponse>
Error Object | Status Code | Content Type |
---|---|---|
errors.ApiErrorInvalidInput | 400 | application/json |
errors.ApiErrorUnauthorized | 401 | application/json |
errors.SDKError | 4xx-5xx | / |
Gets the result of the tables extraction operation using the operation ID.
import { IntunedClient } from "@intuned/client";
const intunedClient = new IntunedClient({
apiKey: "<YOUR_API_KEY_HERE>",
workspaceId: "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee",
});
async function run() {
const result = await intunedClient.files.extractTables.result("aaaabbbCCCCdddd");
// Handle the result
console.log(result)
}
run();
The standalone function version of this method:
import { IntunedClientCore } from "@intuned/client/core.js";
import { filesExtractTablesResult } from "@intuned/client/funcs/filesExtractTablesResult.js";
// Use `IntunedClientCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const intunedClient = new IntunedClientCore({
apiKey: "<YOUR_API_KEY_HERE>",
workspaceId: "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee",
});
async function run() {
const res = await filesExtractTablesResult(intunedClient, "aaaabbbCCCCdddd");
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result)
}
run();
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
operationId |
string | ✔️ | The ID for the requested file operation. This is obtained from the start request. | [object Object] |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. | |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body , are allowed. |
|
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<components.TableExtractionAsyncResponse>
Error Object | Status Code | Content Type |
---|---|---|
errors.ApiErrorInvalidInput | 400 | application/json |
errors.ApiErrorUnauthorized | 401 | application/json |
errors.SDKError | 4xx-5xx | / |