Smile Portal Backend API Documentation

Microsoft Bookings API

API endpoints for managing Microsoft Bookings integration

GET /api/bookings

Retrieve a list of all booking businesses.

Response
{
    "status": "success",
    "data": [
        {
            "id": "string",
            "displayName": "string",
            "businessType": "string",
            "phone": "string",
            "email": "string",
            "webSiteUrl": "string",
            "defaultCurrencyIso": "string",
            "address": {
                "street": "string",
                "city": "string",
                "state": "string",
                "postalCode": "string",
                "countryOrRegion": "string"
            }
        }
    ]
}
GET /api/bookings/{business_id}/appointments

Retrieve all appointments for a specific business.

Query Parameters
Parameter Type Description
include_customer_data boolean Include customer information in the response (default: false)
Response
{
    "status": "success",
    "data": [
        {
            "id": "string",
            "startDateTime": {
                "dateTime": "string",
                "timeZone": "string"
            },
            "endDateTime": {
                "dateTime": "string",
                "timeZone": "string"
            },
            "serviceId": "string",
            "serviceName": "string",
            "duration": "string",
            "price": "number",
            "staffMemberIds": ["string"],
            "customerName": "string",  // Only if include_customer_data=true
            "customerEmail": "string",  // Only if include_customer_data=true
            "customerPhone": "string"   // Only if include_customer_data=true
        }
    ]
}
POST /api/bookings/{business_id}/appointments

Create a new appointment for a specific business.

Request Body
{
    "customerName": "string",
    "customerEmail": "string",  // Optional
    "customerPhone": "string",  // Optional
    "startDateTime": "string",  // ISO 8601 format
    "serviceId": "string",
    "staffMemberIds": ["string"],
    "smsNotificationsEnabled": boolean,  // Optional, defaults to false
    "reminders": [  // Optional, defaults to standard reminder set if not provided
        {
            "message": "string",
            "offset": "string",  // Duration format e.g. P1D (1 day), P2D (2 days), PT2H (2 hours)
            "recipients": "string"  // One of: Customer, Staff, AllAttendees. Defaults to Customer
        }
    ]
}

// Note: If reminders are not provided, the following default set is used:
// - 2 hours before appointment
// - 1 day before appointment
// - 2 days before appointment
// - 5 days before appointment
Response
{
    "status": "success",
    "data": {
        "id": "string",
        "startDateTime": {
            "dateTime": "string",  // ISO 8601 format in UTC
            "timeZone": "UTC"
        },
        "endDateTime": {
            "dateTime": "string",  // ISO 8601 format in UTC
            "timeZone": "UTC"
        },
        "serviceId": "string",
        "serviceName": "string",
        "staffMemberIds": ["string"],
        "smsNotificationsEnabled": boolean,
        "customerName": "string",
        "customerEmailAddress": "string",
        "customerPhone": "string",
        "reminders": [{
            "message": "string",
            "offset": "string",  // Duration format e.g. P1D, PT2H
            "recipients": "customer"
        }]
    }
}
GET /api/bookings/{business_id}/services

Retrieve all services offered by a specific business.

Response
{
    "status": "success",
    "data": [
        {
            "id": "string",
            "displayName": "string",
            "description": "string",
            "duration": "string",
            "price": "number",
            "staffMemberIds": ["string"]
        }
    ]
}
GET /api/bookings/{business_id}/staff

Retrieve all staff members for a specific business.

Response
{
    "status": "success",
    "data": [
        {
            "id": "string",
            "displayName": "string",
            "emailAddress": "string",
            "role": "string",
            "workingHours": [
                {
                    "day": "string",
                    "timeSlots": [
                        {
                            "startTime": "string",
                            "endTime": "string"
                        }
                    ]
                }
            ]
        }
    ]
}

Generate QR Code

POST /qr/generate

Description

Generate a QR code with optional logo embedding and advanced styling options.

Request Body (multipart/form-data)

Name Type Required Description
data string Yes Text or URL to encode in the QR code
logo file No Image file to use as logo
effect string No Visual effect to apply (solid, gradient, rainbow, metallic, neon, pattern)
colors string[] No Colors in hex format (#RRGGBB). For gradient, specify 2+ colors
gradient_direction string No For gradient effect (vertical, horizontal, diagonal, radial, spiral, diamond)
pattern_type string No For pattern effect (checkerboard, dots, stripes, waves, triangles, hexagons)

Visual Effects

Effect Description Required Parameters
solid Single color QR code colors (one color)
gradient Smooth transition between colors colors (2+ colors), gradient_direction
rainbow Colorful rainbow pattern None
metallic Shiny metallic effect colors (one color)
neon Bright neon glow effect colors (one color)
pattern Geometric patterns colors (1+ colors), pattern_type

Example Requests

# Rainbow QR code
curl -X POST -F "data=test" -F "effect=rainbow" \
     https://services.thesmileportal.com/api/qr/generate -o qr.png

# Blue-green diagonal gradient
curl -X POST -F "data=test" -F "effect=gradient" \
     -F "colors=#0000FF,#00FF00" -F "gradient_direction=diagonal" \
     https://services.thesmileportal.com/api/qr/generate -o qr.png

# Gold metallic effect
curl -X POST -F "data=test" -F "effect=metallic" \
     -F "colors=#FFD700" https://services.thesmileportal.com/api/qr/generate -o qr.png

Response

Content-Type: image/png

Binary image data of the generated QR code

Response Codes

Code Description
200 QR code successfully generated
400 Invalid request data
500 Server error
POST /api/messages Rate Limited
Rate Limit: 5 requests per minute per IP address

Description

Creates a new message in the system.

Request Body

{
    "name": "string",
    "phone": "string",
    "email": "string",
    "message_details": "string"
}

Parameters

Name Type Required Description
name string Yes Full name of the sender
phone string Yes Contact phone number
email string Yes Valid email address
message_details string Yes Content of the message

Response Codes

Code Description
201 Message successfully created and notification sent
207 Partial success (e.g., email sent but database storage failed)
400 Invalid request data
429 Rate limit exceeded
500 Server error

Response Format

Success (201)
{
    "error": false,
    "partial_success": false,
    "message": "Message successfully processed",
    "steps": [
        {
            "step": "email_notification",
            "success": true,
            "error": null
        },
        {
            "step": "database_storage",
            "success": true,
            "error": null
        }
    ]
}
Partial Success (207)
{
    "error": true,
    "partial_success": true,
    "message": "Message partially processed",
    "steps": [
        {
            "step": "email_notification",
            "success": true,
            "error": null
        },
        {
            "step": "database_storage",
            "success": false,
            "error": "Database connection failed"
        }
    ]
}
Validation Error (400)
{
    "status": "error",
    "message": "Validation errors",
    "errors": {
        "field_name": ["error message"]
    }
}
Processing Error (400)
{
    "status": "error",
    "message": "Failed to process message",
    "error": "error message"
}
Rate Limit Error (429)
{
    "error": true,
    "message": "Rate limit exceeded",
    "status": "error"
}
Server Error (500)
{
    "error": true,
    "message": "Message processing failed",
    "steps": [
        {
            "step": "email_notification",
            "success": false,
            "error": "error message"
        },
        {
            "step": "database_storage",
            "success": false,
            "error": "error message"
        }
    ]
}
}

Example Request

curl -X POST https://services.thesmileportal.com/api/messages \
    -H "Content-Type: application/json" \
    -d '{
        "name": "John Doe",
        "phone": "+1-555-123-4567",
        "email": "[email protected]",
        "message_details": "Hello, I would like to schedule an appointment."
    }'

Legal Documents

Endpoints for accessing legal documents across all Smile Portal applications

GET /terms

Returns the Terms of Service as an HTML page.

GET /terms/markdown

Returns the Terms of Service in Markdown format.
Content-Type: text/markdown

GET /terms/json

Returns the Terms of Service as a structured JSON object.
Content-Type: application/json

GET /privacy

Returns the Privacy Policy as an HTML page.

GET /privacy/markdown

Returns the Privacy Policy in Markdown format.
Content-Type: text/markdown

GET /privacy/json

Returns the Privacy Policy as a structured JSON object.
Content-Type: application/json

Usage
  • Use the /terms and /privacy endpoints for displaying legal documents in HTML format.
  • Use the /terms/markdown and /privacy/markdown endpoints to retrieve the documents in Markdown format for rendering or export.
  • Use the /terms/json and /privacy/json endpoints to retrieve structured data for programmatic use or integration.