Quickstart
This guide walks you through uploading a document and extracting structured data using the Sterndesk API.Prerequisites
Before you begin, ensure you have:- An API key for authenticating requests. See Authentication for setup instructions.
- An organization and project configured. These are created by default when you initialize your account. If you need to create additional ones, see Organizations and Projects.
Step 1: Get Your Organization ID
First, retrieve your organization ID by listing all organizations you have access to:id value for the next step.
Step 2: Get Your Project ID
List projects within your organization:Step 3: Create an Extraction Schema
Define a schema that describes the structure of data you want to extract. This example creates a schema for research papers:To learn more about defining schemas, see Extraction Schemas.
Step 4: Create an Upload Collector
Create an upload collector that uses your extraction schema. This configures how uploaded files will be processed:To learn more about collectors, see Collectors.
Step 5: Create an Upload
Initiate an upload to get pre-signed URLs for your files. Specify the file sizes and an expiration duration:To learn more about pre-signed URLs and upload strategies, see Upload URLs.
Step 6: Upload Your File
Use the pre-signed URL to upload your file directly. ForUPLOAD_STRATEGY_PUT, use an HTTP PUT request:
Step 7: Poll for Extraction Results
After uploading, Sterndesk automatically processes the file and extracts data according to your schema. Poll the extractions endpoint to check the status:| Status | Description |
|---|---|
DIRECT_UPLOAD_EXTRACTION_STATUS_CREATED | Upload received, processing queued |
DIRECT_UPLOAD_EXTRACTION_STATUS_CONVERTED | Document converted, extraction in progress |
DIRECT_UPLOAD_EXTRACTION_STATUS_STRUCTURED | Extraction complete, data available |
DIRECT_UPLOAD_EXTRACTION_STATUS_STRUCTURED, the extracted data is available in the extractionOutput field:
Next Steps
- Learn more about Extraction Schemas to define complex data structures
- Explore Collectors for different data ingestion methods
- Check out Extractions to understand the extraction pipeline