Code Monkey home page Code Monkey logo

africastalking-go's Introduction

Africa's Talking Golang SDK

tests License: MIT Go Report Card Go Reference

Unofficial Golang SDK for the Africa's Talking API with no external dependencies

Install

go get github.com/edwinwalela/africastalking-go

Quick Start: Sending an SMS

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)
}

Local development

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

Resources

Features

SMS

  • Sending (Bulk & Premium)

Airtime

  • Sending

Voice

  • Call
  • Transfer

TODO

SMS

  • Premium Subscriptions
  • Fetch Messages
  • Notifications

USSD

  • Sessions
  • Notifications

Airtime

  • Query

Payments

  • C2B
  • B2C
  • B2B
  • Bank
  • Card
  • Query

Mobile Data

  • Sending

Contributing

Any contribution, in the form of a suggestion, bug report or pull request, is well accepted.

africastalking-go's People

Contributors

daniel-sogbey avatar edwinwalela avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.