Unofficial Golang SDK for the Africa's Talking API with no external dependencies
go get github.com/edwinwalela/africastalking-go
This example makes use of the sms
package to send bulk sms
package main
import (
"fmt"
"github.com/edwinwalela/africastalking-go/pkg/sms"
)
func main() {
client := &Client{
ApiKey: os.Getenv("AT_API_KEY"),
Username: os.Getenv("AT_USERNAME"),
IsSandbox: true,
}
bulkRequest := &BulkRequest{
To: []string{"+254700000000","+254700000001","+254700000002"},
Message: "Hello AT",
From: "",
BulkSMSMode: true,
RetryDuration: time.Hour,
}
response, err := client.SendBulk(bulkRequest)
fmt.Println(response)
}
Clone repo
git clone https://github.com/EdwinWalela/africastalking-go
Export Africa's talking credentials (sandbox)
A caller ID is required for the Voice API. You can generate one on the sandbox dashboard under Voice > Create Number
export AT_USERNAME=sandbox
export AT_API_KEY=xxxxxxxxxxxxx
export AT_CALLER_ID=+254xxxxxxxxx
Run tests
make test
- Sending (Bulk & Premium)
- Sending
- Call
- Transfer
- Premium Subscriptions
- Fetch Messages
- Notifications
- Sessions
- Notifications
- Query
- C2B
- B2C
- B2B
- Bank
- Card
- Query
- Sending
Any contribution, in the form of a suggestion, bug report or pull request, is well accepted.