Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/uchencho/go-termii

Termii client application written in Go
https://github.com/uchencho/go-termii

Last synced: 6 days ago
JSON representation

Termii client application written in Go

Awesome Lists containing this project

README

        

# Go-Termii

[Termii](https://developers.termii.com/) client application written in Go

## Usage

### Install Package

```bash
go get github.com/Uchencho/go-termii
```

### Documentation

Please see [the docs](https://developers.termii.com/) for the most up-to-date documentation of the Termii API.

#### TERMII

- Sample Usage

```go
package main

import (
termii "github.com/Uchencho/go-termii"
"log"
)

func main() {

// Set TERMII_API_KEY, TERMII_URL and TERMII_SENDER_ID as environment variables
// Ensure TERMII_URL ends with '/' i.e 'https://termii.com/'

req := termii.AutoGeneratedMessageRequest{
To: "2347066554433",
Sms: "Hello from termii", // You do not need to set the API Key in this request struct
}

client := termii.NewClient()
resp, err := client.SendAutoGeneratedMessage(req)
if err != nil {
log.Fatal("error in sending autogenerated message", err)
return
}
log.Printf("Response : %+v", resp)
}

```

> **NOTE**
> Check the `client` directory to see a sample implementation and termii_test.go file to see sample tests