@extends('layouts.app') @section('title', 'Qiz WhatsApp API Documentation') @section('content')

Qiz WhatsApp Messaging API Documentation

Welcome to the Qiz WhatsApp Messaging API documentation. This guide will help you integrate WhatsApp messaging into your applications. With Qiz, you can easily Automate, send and receive WhatsApp messages, manage groups, and handle real-time events using webhooks.

API Version 1.0.0
Base URL: https://qiz-wa.alphaflare.co.ke

  1. Sign up at Qiz Dashboard
  2. On the Dashboard, create a WhatsApp instance and scan the QR code
  3. Click on API Key on the left sidebar to copy/regenerate your API key
  4. Use your API key in the Authorization header for all requests
Note: All API requests require your API key in the Authorization header.

Send Message

Send text, image, video, audio, or document messages to WhatsApp recipients. For media, you can send a file (multipart/form-data) or a URL.

  • Endpoint: POST /send-message
  • Headers:
    Authorization: Bearer your-api-key
            Content-Type: application/json (for text) or multipart/form-data (for media)
  • Text Message Request Body:
    {
            "recipients": ["254712345678", "254798765432"],
            "type": "text",
            "text": "Hello from Qiz!"
            }
  • Image Message Request Body (URL):
    {
            "recipients": ["254712345678"],
            "type": "image",
            "url": "https://example.com/image.jpg",
            "caption": "Check this out!"
            }
  • Image Message Request Body (File Upload):
    Form Data:
            - recipients: ["254712345678"]
            - type: image
            - caption: "Check this out!"
            - file: (select image file)
  • Video Message Request Body:
    {
            "recipients": ["254712345678"],
            "type": "video",
            "url": "https://example.com/video.mp4",
            "caption": "Watch this!"
            }
  • Audio Message Request Body:
    {
            "recipients": ["254712345678"],
            "type": "audio",
            "url": "https://example.com/audio.mp3"
            }
  • Document Message Request Body:
    {
            "recipients": ["254712345678"],
            "type": "document",
            "url": "https://example.com/file.pdf",
            "fileName": "Report.pdf"
            }
  • Success Response (200):
    {
            "success": true,
            "message": "Message sending completed: 2 successful, 0 failed",
            "sent_at": "2023-12-01T12:01:00Z",
            "total_recipients": 2,
            "successful_recipients": ["254712345678@s.whatsapp.net", "254798765432@s.whatsapp.net"],
            "failed_recipients": [],
            "invalid_recipients": []
            }
  • Error Response (400/425/500):
    {
            "success": false,
            "message": "Recipients array is required"
            }
    {
            "success": false,
            "message": "Instance not ready for messaging",
            "status": "not_loaded"
            }

Check Number

Verify if a mobile number is registered on WhatsApp.

  • Endpoint: POST /check-number
  • Headers:
    Authorization: Bearer your-api-key
            Content-Type: application/json
  • Request Body:
    {
            "number": "254712345678"
            }
  • Success Response (200):
    {
            "success": true,
            "number": "254712345678",
            "exists": true
            }
  • Error Response (400/425/500):
    {
            "success": false,
            "message": "No WhatsApp instance found. Please scan your QR code first."
            }

Create Group

Create a new WhatsApp group with a subject and participants.

  • Endpoint: POST /groups
  • Headers:
    Authorization: Bearer your-api-key
    Content-Type: application/json
  • Request Body:
    {
      "subject": "Project Team",
      "participants": ["254712345678", "254798765432"]
    }
  • Success Response (201):
    {
      "success": true,
      "message": "Group created successfully",
      "group": {
        "id": "120363025988888888@g.us",
        "subject": "Project Team",
        "participants": [...]
      }
    }
  • Error Response (400/425/500):
    {
      "success": false,
      "message": "Group subject and participants are required"
    }

List Groups

List all WhatsApp groups for your connected instance.

  • Endpoint: GET /groups?page=1&limit=20
  • Headers:
    Authorization: Bearer your-api-key
  • Success Response (200):
    {
      "success": true,
      "message": "Groups fetched successfully",
      "total": 2,
      "page": 1,
      "limit": 20,
      "groups": [
        {
          "id": "120363025988888888@g.us",
          "name": "Project Team",
          "participantsCount": 2
        }
      ]
    }
  • Error Response (400/425/500):
    {
      "success": false,
      "message": "No WhatsApp instance found. Please scan your QR code first."
    }

  • All endpoints require your API key in the Authorization header.
  • Error codes: 400 Bad Request, 401 Unauthorized, 403 Forbidden, 425 Instance Not Ready, 429 Rate Limit Exceeded, 500 Internal Server Error.
  • Set a webhook URL for your instance to receive real-time events (e.g., message_received, message_sent).
  • For help, contact support@alphaflare.co.ke or WhatsApp Support.
@endsection @push('styles') @endpush @push('scripts') @endpush