The site is currently in beta.
WhatsApp API

WhatsApp API quick start: your keys and your first message

Smart One Group support teamLast updated: 5 min read

Short answer

To send a WhatsApp message from your app with the Smart One Group WhatsApp API, link your number first, then copy the “API key” and “Secret key” from the “Link API” tab in WhatsApp. Send a POST request to https://sog.sog.eg/api/whatsapp/create-message with appkey, authkey, to and message. A successful reply is 200 with a message_id, and the message goes out from your linked number.

On this page

Steps to send your first message

  1. Step 1: Link a WhatsApp number

    Messages go out from a linked number that is Connected. If you have not done it yet, follow how to link a WhatsApp number.

  2. Step 2: Copy the keys and the send URL

    Open WhatsApp → the Link API tab. Copy the API key (sent as appkey), the Secret key (sent as authkey) and the Send URL. Keep the keys in environment variables on your server, not in your code.

  3. Step 3: Send your first message

    Send a POST with appkey, authkey, to (the recipient in international format, such as 201012345678) and message. Add the Accept: application/json header so any error comes back as JSON.

    curl -X POST https://sog.sog.eg/api/whatsapp/create-message \
      -H "Accept: application/json" \
      -d appkey=YOUR_API_KEY \
      -d authkey=YOUR_SECRET_KEY \
      -d to=201012345678 \
      -d message="Hello from Example Store 👋"
  4. Step 4: Read the response

    A 200 means WhatsApp accepted the message from your number; keep data.id to check its status later. Any other response carries a message explaining why, usually with a code listed in the error table.

    {
      "message_status": "Success",
      "data": {
        "id": 4182,
        "to": "201012345678",
        "status_code": 200,
        "message_id": "3EB0A1C2D3E4F5A6B7C8"
      }
    }

Which package limits apply to the API?

The Package & usage tab shows your package and end date, messages used against the limit, devices, apps, and every included feature. What matters most for your app:

  • Message limit: once reached, you get 403 with the code quota_exceeded, sometimes with a suggested upgrade.
  • Minimum seconds between messages: sending faster returns 429 with the code rate_limited; wait and retry.
  • Request rate: up to 60 requests a minute from the same IP address across the API.
  • Features: media, templates, campaigns and webhooks work only when your package includes them; otherwise you get feature_disabled.

How do I keep the API keys safe?

  • Call the API from your server only. Never put the keys in browser JavaScript or inside a mobile app.
  • Give each system its own app: type a name under App name (optional) and click Add app, within your package app limit.
  • If a key leaks, click Rotate keys straight away; the old keys stop working at once, so update your server with the new ones.

How can I test without sending real messages?

Request Sandbox keys once, using your current keys. Every send with the sandbox keys returns 200 and a message id starting with sandbox-, and nothing reaches WhatsApp, so you can test your code safely. Sandbox keys count as one app toward your package app limit, so a full limit returns quota_exceeded.

curl -X POST https://sog.sog.eg/api/whatsapp/sandbox \
  -H "Accept: application/json" \
  -d appkey=YOUR_API_KEY \
  -d authkey=YOUR_SECRET_KEY

# → 201 {"data":{"appkey":"…","authkey":"…","sandbox":true}}
# Use the returned keys while testing: every send answers 200 with a
# message_id like "sandbox-12", and nothing is delivered to WhatsApp.

Common questions

Ideally international digits only, such as 201012345678 or +201012345678. A local Egyptian number like 01012345678 is accepted and converted to international format automatically.

create-message is the simplest way to send text only. send handles text, images, files and templates, plus an Idempotency-Key header against duplicates; see the WhatsApp API reference.

The keys are wrong or were rotated, or the package subscription is not active. Copy both keys again from the Link API tab and check your subscription status under Subscriptions.

Do not. Any code that runs in the browser exposes your keys to every visitor. Send the request from your web server and have the page call your server.

Ready to start?

WhatsApp API quick start: your keys and your first message

Open my API keys