Developer Guide

API Integration

Integrate CMzon WhatsApp Cloud API with your existing systems, applications, and workflows for seamless business automation.

30 min read
Advanced
Developer

Integration Types

Connect CMzon with your favorite business tools

CRM Integration

Connect with popular CRM systems like Salesforce, HubSpot, and Pipedrive

Features:

  • Contact sync
  • Lead management
  • Deal tracking
  • Activity logging

Examples:

SalesforceHubSpotPipedriveZoho CRM

E-commerce Integration

Integrate with online stores and marketplaces for order management

Features:

  • Order notifications
  • Inventory updates
  • Customer support
  • Abandoned cart recovery

Examples:

ShopifyWooCommerceMagentoBigCommerce

Marketing Automation

Connect with marketing platforms for automated campaigns

Features:

  • Campaign triggers
  • Lead scoring
  • Email integration
  • Analytics tracking

Examples:

MailchimpActiveCampaignPardotMarketo

Custom Applications

Build custom integrations with your own applications

Features:

  • REST API access
  • Webhook support
  • Custom workflows
  • Real-time data sync

Examples:

Custom CRMInternal toolsMobile appsWeb applications

API Endpoints

Complete reference for all available API endpoints

Messages

Send and manage WhatsApp messages

POST/messagesSend text, media, or template messages
GET/messages/{id}Get message status and details
POST/messages/mark-readMark messages as read

Contacts

Manage contact information and groups

GET/contactsRetrieve all contacts
POST/contactsCreate or update contacts
GET/contacts/{id}Get specific contact details
DELETE/contacts/{id}Delete a contact

Campaigns

Create and manage broadcast campaigns

POST/campaignsCreate a new campaign
GET/campaignsList all campaigns
GET/campaigns/{id}Get campaign details
POST/campaigns/{id}/sendSend a campaign

Webhooks

Receive real-time updates and events

POST/webhooks/messageReceive incoming messages
POST/webhooks/statusReceive message status updates
POST/webhooks/contactReceive contact updates

Code Examples

Get started quickly with these code samples

Send a Message

JavaScript
// Send a text message
const response = await fetch('https://api.cmzon.com/v1/messages', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer YOUR_API_KEY',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    to: '+1234567890',
    type: 'text',
    text: {
      body: 'Hello! This is a test message from CMzon API.'
    }
  })
});

const result = await response.json();
console.log('Message sent:', result);

Create a Contact

Python
import requests

# Create a new contact
url = "https://api.cmzon.com/v1/contacts"
headers = {
    "Authorization": "Bearer YOUR_API_KEY",
    "Content-Type": "application/json"
}
data = {
    "phone": "+1234567890",
    "name": "John Doe",
    "email": "[email protected]",
    "custom_fields": {
        "company": "Acme Corp",
        "source": "website"
    }
}

response = requests.post(url, headers=headers, json=data)
contact = response.json()
print(f"Contact created: {contact['id']}")

Handle Webhook

Node.js
const express = require('express');
const app = express();

app.use(express.json());

// Handle incoming messages
app.post('/webhook/message', (req, res) => {
  const { from, message, timestamp } = req.body;
  
  console.log(`Received message from ${from}: ${message.text.body}`);
  
  // Process the message
  // Send auto-reply, update CRM, etc.
  
  res.status(200).send('OK');
});

// Handle message status updates
app.post('/webhook/status', (req, res) => {
  const { messageId, status, timestamp } = req.body;
  
  console.log(`Message ${messageId} status: ${status}`);
  
  // Update your database with message status
  
  res.status(200).send('OK');
});

app.listen(3000, () => {
  console.log('Webhook server running on port 3000');
});

Integration Setup

Follow these steps to integrate with your systems

1

Get API Credentials

Obtain your API key and access tokens

Key Actions:

  • Log into your CMzon dashboard
  • Navigate to API Settings section
  • Generate your API key and secret
  • Configure webhook endpoints
  • Set up authentication headers
2

Choose Integration Method

Select the best integration approach for your needs

Key Actions:

  • REST API for real-time communication
  • Webhooks for event-driven updates
  • SDK for easier development
  • Pre-built connectors for popular platforms
  • Custom integration using our API
3

Implement Authentication

Set up secure authentication for your integration

Key Actions:

  • Use OAuth 2.0 for secure access
  • Implement API key authentication
  • Set up webhook signature verification
  • Configure rate limiting and throttling
  • Test authentication endpoints
4

Build Your Integration

Develop the integration logic and data flow

Key Actions:

  • Map data fields between systems
  • Implement data synchronization logic
  • Handle error cases and retries
  • Set up logging and monitoring
  • Create fallback mechanisms
5

Test and Deploy

Thoroughly test your integration before going live

Key Actions:

  • Test all API endpoints and webhooks
  • Verify data accuracy and completeness
  • Test error handling and edge cases
  • Deploy to staging environment first
  • Monitor performance and fix issues

Ready to Integrate?

Start building powerful integrations that connect WhatsApp with your business systems.