The below guide is a walkthrough of how to upload a CSV/PDF or any file type to Catalyzed AI’s platform.
<aside> 💡
API endpoint → https://platform-api.us.catalyzed.ai
</aside>
/files/upload-url
endpoint to generate a presigned S3 URL which facilitates the file upload/files/{file_id}/complete
endpoint hereSet 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",
}
Load in your file and details such as the file name.
mode="rb"
to open the file since we want the file to be passed as Raw Bytes.
# File to upload
file_name = "test.csv"
csv = open(file_name, mode="rb").read()