Official SDKs
Go SDK
Official Go SDK for Notify Africa SMS API integrations.
Go
Install
go get github.com/tacherasasi/notify-africa-goSource
SMS Methods
| Method | SMS endpoint |
|---|---|
SendSingleSMS(ctx, phoneNumber, message, senderID) | POST /api/v1/api/messages/send |
SendBatchSMS(ctx, phoneNumbers, message, senderID) | POST /api/v1/api/messages/batch |
CheckMessageStatus(ctx, messageID) | GET /api/v1/api/messages/status/{messageId} |
Example
package main
import (
"context"
"log"
"os"
"github.com/tacherasasi/notify-africa-go/sms"
)
func main() {
client := sms.NewClient(os.Getenv("NOTIFY_SMS_API_KEY"))
result, err := client.SendSingleSMS(
context.Background(),
"255712345678",
"Hello from Notify Africa",
"MYBRAND",
)
if err != nil {
log.Fatal(err)
}
log.Println(result.Data.MessageID, result.Data.Status)
}