Poll Schema Extraction Results
Retrieves the results of a schema extraction job.
Endpoint
GET /generate-json-from-file/poll-results/{job_id}
Headers
Authorization: Bearer {your-api-key}
project_id: {Project ID}
Path Parameters
Parameter | Type | Description |
---|---|---|
job_id | string | The ID of the schema extraction job |
Response
{
"job_id": "string", // ID of the extraction job
"status": "string", // Current job status
"created_at": "datetime", // Job creation timestamp
"result": {
"schema_name": "string", // Name of the schema used
"extracted_data": {
// Extracted fields
"field_name": {
"name": "string",
"extracted": {
"value": "string|number|null", // Extracted value
"confidence": 0.95, // Confidence score (0-1)
"source_context": "string", // Source text context
"page_number": 1 // Page number in document
},
"fields": {
// Nested fields (optional)
"nested_field": {
// Same structure as parent field
}
},
"items": [
// Array items (optional)
{
"item_field": {
// Same structure as parent field
}
}
]
}
},
"processing_metadata": {} // Processing metadata
}
}
Example Requests
cURL
curl -X GET \
'https://api.example.com/generate-json-from-file/poll-results/123e4567-e89b-12d3-a456-426614174000' \
-H 'Authorization: Bearer your-api-key' \
-H 'project_id: your-project-id'
Python
import requests
url = "https://api.example.com/generate-json-from-file/poll-results/123e4567-e89b-12d3-a456-426614174000"
headers = {
"Authorization": "Bearer your-api-key",
"project_id": "your-project-id"
}
response = requests.get(url, headers=headers)
Node.js
const axios = require("axios");
const url =
"https://api.example.com/generate-json-from-file/poll-results/123e4567-e89b-12d3-a456-426614174000";
const headers = {
Authorization: "Bearer your-api-key",
project_id: "your-project-id",
};
axios.get(url, { headers }).then((response) => console.log(response.data));
Error Responses
Status | Description |
---|---|
500 | Failed to get job status |