Get Folders

πŸ“ Get Folders

Get the list of your folders.

import json
import requests

# Define the API key as a variable
api_key = 'your_api_key_here'  # Replace with your actual API key

# Set up the headers, including the API key
headers = {
    'Content-Type': 'application/json',
    'Authorization': f'Bearer {api_key}',  # Use the variable here
    'Accept': 'application/json'
}


# The URL to your Lambda function exposed through an API Gateway endpoint
url = "https://api.tor.app/folders/get-folders"

# Make the GET request
response = requests.get(url, headers = headers)

# Parse the JSON response content
content = json.loads(response.content)

# Print the content
print(content)

200 OK - Successful Query
[{
    "id": "folder_id",
    "PK": "api_key",
    "SK": "SK",
    "Fname": "folder name"
}]

400 Bad Request - Missing API Key
{
    "error": "Bad Request",
    "message": "API key is required as a query parameter."
}

500 Internal Server Error - Database Error
{
    "error": "Internal Server Error",
    "message": "Error querying database."
}