Send an SMS Using Go

Share on Facebook0Tweet about this on TwitterShare on LinkedIn0Share on Google+0

The TextMagic API Go wrapper can save you a lot of time, as it includes all the necessary API commands and tests. It only takes a few seconds to download it from GitHub and to install it into your own app or software. After installation, you’ll then be able to send text messages.

Get it now on GitHub

Installation Instructions

Run the following command to install the TextMagic Go helper:

go get github.com/textmagic/textmagic-rest-go

Requirements

The Go wrapper for the TextMagic API has no requirements other than the Go distribution.

Sending an SMS using Go (an example)

Below is an example on how to send a text message using Go:

package main
 
import (
  "fmt"
  textmagic "github.com/textmagic/textmagic-rest-go"
)
 
func main() {
  client := textmagic.NewClient("<USERNAME>", "<APIV2_KEY>")
  
  params := map[string]string{
    "phones": "99900000",
    "text"  : "Hello from TextMagic Go",
  }
  message, err := client.CreateMessage(params)
 
  if err != nil {
    fmt.Println(err)
  } else {
    fmt.Println(message.Id)
  }
}

Support

If you need help with the wrapper, or if you have any suggestions for improvements and/or if you have any enquiries regarding the Go SMS API, please contact us by emailing support@textmagic.com.