DecimalEncoder (index.py)

sample-voice-agent · infrastructure/src/functions/crm-api/index.py · python · MIT-0
crm, CRM / Leads, integration, infra, tag:customer-data, tag:case-management

CRM API Lambda Handler Provides REST API endpoints for customer data, cases, and interaction tracking. Designed for integration with voice agent applications.

# Source: https://github.com/aws-solutions-library-samples/sample-voice-agent | License: MIT-0 | Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved
# Provided via justclaw.it.com; keep this notice with the code.
"""
CRM API Lambda Handler

Provides REST API endpoints for customer data, cases, and interaction tracking.
Designed for integration with voice agent applications.
"""

import json
import os
import uuid
import re
from datetime import datetime
from decimal import Decimal
from typing import Dict, Any, Optional, List
import boto3
from boto3.dynamodb.conditions import Key, Attr

# Initialize DynamoDB resource
dynamodb = boto3.resource("dynamodb")

# Get table names from environment
customers_table_name = os.environ.get("CUSTOMERS_TABLE", "")
cases_table_name = os.environ

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key