The below guide is a walkthrough of how to upload a CSV/PDF or any file type to Catalyzed AI’s platform.

<aside> 💡

API endpointhttps://platform-api.us.catalyzed.ai

</aside>

Brief Overview/Summary of Steps

  1. Generate Upload URL
    1. We need to use the /files/upload-url endpoint to generate a presigned S3 URL which facilitates the file upload
  2. Use the Presigned URL to upload the file to S3
    1. This is going to be a PUT request with the file being passed
  3. Mark File as Complete
    1. This step verifies that the file has been uploaded successfully and can now be used in the platform
    2. We use the /files/{file_id}/complete endpoint here

Step 1: Configure Access to Catalyzed API

Set up authentication and authorization values (ie. API token and Bearer token) that are required to access the APIs.

import httpx
import os
import hashlib

# Replace with your actual values
api_token = "<your_api_token>" 
endpoint = "<https://platform-api.us.catalyzed.ai>" # This is useful as we can just append the endpoint to this base URL
headers = {
    "Authorization": f"Bearer {api_token}",
    "Content-Type": "application/json",
}

Step #2: Set up your File for Upload

Load in your file and details such as the file name.


# File to upload
file_name = "test.csv"
csv = open(file_name, mode="rb").read()