Spektr API Integration Guide
To integrate with Spektr's APIs, follow these high-level steps to manage datasets, execute processes, and export results within the platform:
Import Overview
1. Create a Dataset Schema
- Purpose: Define the structure of your dataset by specifying the fields and their data types.
- Action: Use the Import API to create a new dataset, outlining the schema that includes all necessary fields such as text, numbers, dates, or files.
- Outcome: A dataset is created and becomes available on the platform, ready to accept data entries that conform to the defined schema.
2. Import Records into the Dataset
- Purpose: Add data entries to your dataset based on the schema you've defined.
- Action: Use the Import API to submit records to the dataset. Each record should include values for the fields specified in your schema.
- File fields handling: If your dataset includes file fields (e.g., documents, images), provide placeholders or filenames for these fields in your records.
- Outcome: Records are added to your dataset, and for any file fields, the API responds with presigned URLs for file uploads along with unique
spektrIdsfor each record.
3. Upload Files Using Presigned URLs
- Purpose: Upload the actual files associated with the file fields in your dataset records.
- Action: Use the presigned URLs provided by the API to upload files directly to the storage service (AWS S3). This involves making a POST request with the file data to the specified URL.
- Considerations: Presigned URLs are time-sensitive, so it's important to upload the files promptly. The presigned URL expires in 1 hour from the time it is generated.
- Outcome: Files are successfully uploaded and associated with the corresponding records in your dataset.
Execution Overview
1. Execute Processes Using spektrIds
spektrIds- Purpose: Execute specific processes defined in the platform using your imported data.
- Action: Use the Execution API to initiate processes by providing the
processId(obtained from the platform) and the list ofspektrIdscorresponding to your dataset records. - Outcome: The specified processes are executed for the provided records. Results can be obtained in our platform, through Fetch customer records Endpoint or through Webhooks .
Export Overview
1. Fetch customer records
- Purpose: Retrieve the results of your executed processes.
- Action: Use the Records API to query customer records using the
spektrIdsof your processed records. - Outcome: Access processed data, analyse results, and any generated outputs.
