Skip to content

Quickstart

Get started with the CubeConnect API in 5 minutes.

Prerequisites

  • A CubeConnect account with an active subscription
  • A connected WhatsApp Business account
  • An API key (generated from dashboard)

Step 1: Get Your API Key

  1. Log in to CubeConnect Dashboard
  2. Go to Settings > API Keys
  3. Click Generate New Key
  4. Copy and store the key securely

WARNING

Your API key is shown only once. Store it in a secure location like an environment variable.

Step 2: Test Your Connection

Verify your API key works by calling the health check endpoint:

bash
curl https://cubeconnect.io/api/health

Expected response:

json
{
  "success": true,
  "data": {
    "status": "healthy",
    "checks": {
      "app": true,
      "database": true,
      "cache": true
    },
    "timestamp": "2026-02-27T12:00:00Z"
  }
}

Step 3: Send Your First Message

Send a text message to a WhatsApp number:

bash
curl -X POST https://cubeconnect.io/api/v1/messages/send \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "phone": "+966501234567",
    "message_type": "text",
    "data": {
      "body": "Hello from CubeConnect API!"
    }
  }'

Expected response:

json
{
  "success": true,
  "data": {
    "status": "queued",
    "message_log_id": 1,
    "conversation_category": "SERVICE",
    "cost": 0.0
  }
}

INFO

Text messages require the customer to have messaged you within the last 24 hours. For first-time messages, use a template message.

Step 4: Send a Template Message

Templates can be sent anytime, without the 24-hour restriction:

bash
curl -X POST https://cubeconnect.io/api/v1/messages/send \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "phone": "+966501234567",
    "message_type": "template",
    "data": {
      "name": "hello_world"
    }
  }'

What's Next?

CubeConnect WhatsApp Business Platform