Hypersender

Messaging APIs

WhatsApp APISend and receive from your own numberSMS gateway appApproved on Google Play, Android 9 to 16OTP APICodes and WhatsApp sign-in links

Build with it

MCP serverWhatsApp and SMS from your AI assistantIntegrationsn8n, AI assistants and SDKsWhatsApp API pricingPlans, and per-message costs comparedDocsAPI reference and setup guides
SDKsLaravelNode.jsPythonGon8n

WhatsApp

CRM integrationPayment remindersOrder updatesWhatsApp OTPIncoming message webhooksWhatsApp AI chatbotCustomer serviceWhatsApp automationMessaging from LaravelClaude to WhatsAppChatGPT integrationZapier and Make

SMS

Appointment remindersSMS OTPFilter and tag SMSSMS forwardingSMS gateway appAndroid SMS gateway
All use cases
WhatsApp link generatorA short chat link with a ready message, a QR code with your logo and a button for your website.WhatsApp message templatesReady messages for orders, appointments and payments, with a builder that checks them against Meta's rules.WhatsApp text formatterBold, italic, strikethrough, lists and quotes, with keyboard shortcuts and a live iPhone preview.SMS character counterCharacters, SMS parts and GSM-7 or Unicode, plus the characters that make a message longer.Phone validatorCheck if a number is valid, see its country and line type, and copy it in E.164 or WhatsApp format. Works on lists too.Name decorationStylish versions of a name in English or Arabic for PUBG, Free Fire, Instagram and TikTok.
All free tools

Company

BlogGuides, tutorials and comparisonsAlternativesHypersender vs WATI, Twilio and moreAbout HypersenderWho we are and how we workFAQsShort answers to common questions

Community

Latest postNovember 28, 2026Send WhatsApp Message From Google Sheets With Apps ScriptSend WhatsApp message from Google Sheets: a free Apps Script that sends one message per row from your own number, with an SMS version.Read the post
PricingDocs
Sign InGet Started
Hypersender

Product

  • Features
  • Use cases
  • MCP server
  • Pricing
  • WhatsApp API pricing
  • SDKs
  • Integrations
  • Docs

Free tools

  • WhatsApp link generator
  • WhatsApp message templates
  • WhatsApp text formatter
  • SMS character counter
  • Phone validator
  • Name decoration
  • All tools

Resources

  • About Hypersender
  • FAQ
  • Blog
  • Alternatives
  • Discord
  • WhatsApp

Legal

  • Terms and Conditions
  • Privacy Policy
Featured onFeatured on LaunchAFFeatured on LaunchAFFeatured on Twelve ToolsFeatured on Twelve Tools

© 2026 Hypersender. All rights reserved.

GET IT ONGoogle Play
HypersenderHypersenderHypersenderHypersenderHypersender
All articles

Developer guides

Golang WhatsApp API: Send and Receive Messages in Go

Golang WhatsApp guide: send messages and images from your own number with the Hypersender Go SDK, and receive replies with a net/http webhook.

Hypersender·November 28, 2026·3 min read
Golang WhatsApp API: Send and Receive Messages in GoGolang WhatsApp API: Send and Receive Messages in Go
On this page
  1. whatsmeow, a self-hosted gateway, or a hosted API
  2. Install the Go SDK
  3. Send a WhatsApp message from Go
  4. Send an image
  5. Receive messages and reply
  6. SMS and OTP from the same SDK
  7. Next steps

On this page

  1. whatsmeow, a self-hosted gateway, or a hosted API
  2. Install the Go SDK
  3. Send a WhatsApp message from Go
  4. Send an image
  5. Receive messages and reply
  6. SMS and OTP from the same SDK
  7. Next steps

For Golang WhatsApp messaging you have two routes: run the whatsmeow library yourself, or call a hosted API from Go. This guide takes the second, with the Hypersender Go SDK. You send a text and an image from your own number, then receive messages with a plain net/http handler and reply to them.

whatsmeow, a self-hosted gateway, or a hosted API

Most Go WhatsApp projects you'll find fall into one of these:

OptionYou runYou look after
whatsmeow, the Go libraryThe WhatsApp client inside your own programSession storage, reconnects, and updates whenever WhatsApp changes its protocol
A REST gateway built on whatsmeow (GOWA, WuzAPI)A separate server that wraps the libraryThe server, its database, uptime and upgrades
A hosted API such as HypersenderNothing extra. Your Go code makes HTTPS callsOnly your own app. Sessions, servers and webhooks are handled for you

whatsmeow is free and powerful if you want full control and don't mind running it. The hosted route costs a flat monthly price per number and leaves you with a dependency-free SDK, webhooks, webhook logs and alerts when WhatsApp restricts a number. Both link a regular number by QR code, outside Meta's official API, so the same WhatsApp rules apply.

Install the Go SDK

You need Go 1.24 or newer and a Hypersender account with a WhatsApp instance linked by QR code. Then:

bash
go get github.com/hypersender/hypersender-go

The SDK uses only the standard library. It reads its credentials from the environment:

bash
export HYPERSENDER_WHATSAPP_API_KEY=your_api_key
export HYPERSENDER_WHATSAPP_INSTANCE_ID=your_instance_id

Send a WhatsApp message from Go

go
package main
 
import (
	"context"
	"fmt"
	"log"
 
	hypersender "github.com/hypersender/hypersender-go"
)
 
func main() {
	ctx := context.Background()
	client := hypersender.NewClient()
 
	res, err := client.WhatsApp.SendTextSafe(ctx, "201001234567@c.us", "Hi Omar, your order #1042 has shipped.", nil)
	if err != nil {
		log.Fatal(err)
	}
 
	fmt.Println("queued:", res["queued_request_uuid"])
}

Run it with go run . and the message reaches the phone a moment later.

  • SendTextSafe shows "typing…" and pauses briefly first, so many messages go out at a natural pace. SendText sends immediately, which suits login codes.
  • The chat ID is the number with its country code and no +, followed by @c.us. Groups end in @g.us.
  • Every method takes a context.Context first, so timeouts and cancellation work as in the rest of your code. Requests are queued and return a queued_request_uuid straight away.

Send an image

Media methods take a URL or any io.Reader:

go
_, err := client.WhatsApp.SendImage(ctx, "201001234567@c.us",
	hypersender.MediaURL("https://example.com/receipts/1042.png"),
	&hypersender.MediaOptions{Caption: "Your receipt for order #1042"})

To upload a local file instead, pass hypersender.MediaFile("receipt.png", f) with an open *os.File. Files, videos, voice notes, polls and locations work the same way; the Go send-messages reference lists them all.

Receive messages and reply

Hypersender posts every new message to your webhook URL, with your secret in the Authorization header. This small bot answers two keywords and shows a menu for anything else:

go
package main
 
import (
	"crypto/subtle"
	"encoding/json"
	"log"
	"net/http"
	"os"
	"strings"
 
	hypersender "github.com/hypersender/hypersender-go"
)
 
var (
	secret = os.Getenv("HYPERSENDER_WHATSAPP_WEBHOOK_SECRET")
	client = hypersender.NewClient()
)
 
type webhook struct {
	Event string `json:"event"`
	Data  struct {
		Payload struct {
			From   string `json:"from"`
			Body   string `json:"body"`
			FromMe bool   `json:"fromMe"`
		} `json:"payload"`
	} `json:"data"`
}
 
func handle(w http.ResponseWriter, r *http.Request) {
	if subtle.ConstantTimeCompare([]byte(r.Header.Get("Authorization")), []byte(secret)) != 1 {
		http.Error(w, "unauthorized", http.StatusUnauthorized)
		return
	}
	var hook webhook
	if err := json.NewDecoder(r.Body).Decode(&hook); err != nil {
		http.Error(w, "bad request", http.StatusBadRequest)
		return
	}
	msg := hook.Data.Payload
	// Only new messages from people: skip receipts, your own messages and groups.
	if hook.Event != "message.any" || msg.FromMe || !strings.HasSuffix(msg.From, "@c.us") {
		w.WriteHeader(http.StatusOK)
		return
	}
 
	reply := "Hi! Reply *hours* for our opening hours or *order* to track an order."
	switch strings.ToLower(strings.TrimSpace(msg.Body)) {
	case "hours":
		reply = "We're open Sunday to Thursday, 9 am to 6 pm."
	case "order":
		reply = "Send your order number and we'll check it for you."
	}
 
	if _, err := client.WhatsApp.SendText(r.Context(), msg.From, reply, nil); err != nil {
		log.Println("reply failed:", err)
	}
	w.WriteHeader(http.StatusOK)
}
 
func main() {
	if secret == "" {
		log.Fatal("set HYPERSENDER_WHATSAPP_WEBHOOK_SECRET")
	}
	http.HandleFunc("POST /whatsapp/webhook", handle)
	log.Fatal(http.ListenAndServe(":8080", nil))
}

Run it, expose port 8080 with a tunnel such as ngrok while you build, and add the HTTPS URL plus the same secret to your instance's webhooks in the dashboard. Message your number and the bot replies.

  • subtle.ConstantTimeCompare checks the secret without leaking timing, and the program won't start with an empty secret.
  • fromMe is true for messages your own number sent, so the bot doesn't answer itself.
  • The handler replies in the request. For slow work, return 200 first and process the message in a goroutine or a queue. The Go webhooks guide lists every event.

The same handler works in Gin, Echo or chi, since they all accept a standard http.HandlerFunc.

SMS and OTP from the same SDK

The Go SDK also covers the SMS API, which sends from the SIM in an Android phone, and the OTP API for login codes and WhatsApp sign-in links. Set HYPERSENDER_SMS_* or HYPERSENDER_OTP_* variables and the same client has client.SMS and client.OTP. See the WhatsApp OTP use case for the login flow.

Next steps

  • Write messages that pass WhatsApp's rules with the message templates tool
  • Read how to avoid a WhatsApp number ban before you message a list
  • Compare costs on the WhatsApp API pricing page

Create a Hypersender account, link your number with a QR code and send your first message from Go. The first 14 days are free.

Keep reading

Send WhatsApp Message From Google Sheets With Apps ScriptSend WhatsApp Message From Google Sheets With Apps Script

Developer guides

Send WhatsApp Message From Google Sheets With Apps Script

Send WhatsApp message from Google Sheets: a free Apps Script that sends one message per row from your own number, with an SMS version.

November 28, 2026·3 min read

By Hypersender

WhatsApp Message Limit Per Day: App, API and Business TiersWhatsApp Message Limit Per Day: App, API and Business Tiers

Guides

WhatsApp Message Limit Per Day: App, API and Business Tiers

WhatsApp message limit per day: the app's caps on new chats and broadcasts, Meta's 250 to unlimited API tiers, and how to send without hitting them.

November 28, 2026·2 min read

By Hypersender

WhatsApp vs WhatsApp Business: Which One You NeedWhatsApp vs WhatsApp Business: Which One You Need

Guides

WhatsApp vs WhatsApp Business: Which One You Need

WhatsApp vs WhatsApp Business: what the business account label means, what each app can do, and when you need the API instead.

November 28, 2026·2 min read

By Hypersender

Start Sending WhatsApp and SMS Messages Today

Start a free trial: 14 days for WhatsApp and 28 days for SMS, with up to 100 messages a day.

Contact SalesGet Started