API Documentation

Complete guides, API references, and code examples to help you integrate Talk To Office into your applications.

Quick Start

Getting Started in 5 Minutes

1. Create an Account

Sign up for a free account at talktooffice.com

https://talktooffice.com/register

2. Get Your API Key

Navigate to Dashboard → API Keys → Create New Key

API_KEY=vf_sk_1234567890abcdef

3. Make Your First Request

Send a test message to the AI bot

curl -X POST https://api.talktooffice.com/v1/bot/message \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "message": "Hello, I need help",
    "channel": "api",
    "customer_id": "user_123"
  }'

4. Response

{
  "success": true,
  "data": {
    "response": "Hello! I'm here to help. How can I assist you today?",
    "conversation_id": "conv_abc123",
    "timestamp": "2025-01-19T12:00:00Z"
  }
}

API Reference

Authentication

Learn how to authenticate your API requests using API keys and OAuth.

POST /api/v1/auth/loginPOST /api/v1/auth/register

Bot API

Send messages, retrieve conversations, and interact with AI bot.

POST /api/v1/bot/messageGET /api/v1/bot/inventory

Voice API

Process voice messages, transcribe audio, and synthesize speech.

POST /api/v1/voice/transcribePOST /api/v1/voice/synthesize

Webhooks

Configure webhooks to receive real-time notifications about events.

POST /api/v1/webhooksGET /api/v1/webhooks

Organizations

Manage organization settings, users, and subscription.

GET /api/v1/organizationsPUT /api/v1/organizations

API Keys

Create, manage, and rotate API keys for secure access.

POST /api/v1/api-keysDELETE /api/v1/api-keys/:id

Code Examples

JavaScript / Node.js

const axios = require('axios');

const voiceflow = axios.create({
  baseURL: 'https://api.talktooffice.com/v1',
  headers: {
    'Authorization': `Bearer ${process.env.VOICEFLOW_API_KEY}`,
    'Content-Type': 'application/json'
  }
});

// Send a message
async function sendMessage(message) {
  const response = await voiceflow.post('/bot/message', {
    message: message,
    channel: 'api',
    customer_id: 'user_123'
  });
  return response.data;
}

sendMessage('Hello!').then(console.log);

Python

import requests
import os

API_KEY = os.getenv('VOICEFLOW_API_KEY')
BASE_URL = 'https://api.talktooffice.com/v1'

def send_message(message):
    response = requests.post(
        f'{BASE_URL}/bot/message',
        headers={
            'Authorization': f'Bearer {API_KEY}',
            'Content-Type': 'application/json'
        },
        json={
            'message': message,
            'channel': 'api',
            'customer_id': 'user_123'
        }
    )
    return response.json()

print(send_message('Hello!'))

PHP

<?php
$apiKey = getenv('VOICEFLOW_API_KEY');
$baseUrl = 'https://api.talktooffice.com/v1';

function sendMessage($message) {
    global $apiKey, $baseUrl;

    $ch = curl_init("$baseUrl/bot/message");
    curl_setopt($ch, CURLOPT_HTTPHEADER, [
        "Authorization: Bearer $apiKey",
        "Content-Type: application/json"
    ]);
    curl_setopt($ch, CURLOPT_POST, true);
    curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([
        'message' => $message,
        'channel' => 'api',
        'customer_id' => 'user_123'
    ]));
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

    $response = curl_exec($ch);
    curl_close($ch);
    return json_decode($response);
}

print_r(sendMessage('Hello!'));

Additional Resources

API Reference

Complete API documentation

Guides

Step-by-step tutorials

Support

Get help from our team