# README
Go-Termii
Termii client application written in Go
Usage
Install Package
go get github.com/Uchencho/go-termii
Documentation
Please see the docs for the most up-to-date documentation of the Termii API.
TERMII
- Sample Usage
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
# Packages
No description provided by the author
# Functions
ConfigFromEnvVars provides the default config from env vars for termii.
NewClient creates a termii client using configuration variables.
# Structs
AutoGeneratedMessageRequest is a representation of a send message request with an auto generated "source" number.
AutoGeneratedMessageResponse is a representation of a send message response from an auto generated "source" number.
Client is a representation of a termii client.
Config is a representation of config variables.
No description provided by the author
FetchSenderIdData is a representation of a fetch senderId data nested object.
FetchSenderIdResponse is a representation of a fetch senderID response.
GenerateTokenRequest is a representation of a generate in app token request.
GenerateTokenResponse is a representation of a generate token response.
GetBalanceResponse is a representation of a get balance response.
HistoryResponse is a representation of a get history response.
InAppTokenDataResponse is a representation of the data field returned.
Media is a representation of a media request.
No description provided by the author
RegisterSenderIdRequest is a representation of a register sender reuest.
RegisterSenderResponse is a repreentation of a register sender response.
No description provided by the author
SendMesageRequest is a representation of a send message request.
SendMessageResponse is a representation of a send message response.
SendTokenRequest is a representation of a send token request.
SendTokenResponse is a representation of a send token response.
StatusRequest is a representation of a status request.
StatusResponse is a representation of a status response.
No description provided by the author
TemplateData is a representation of a template data.
TemplateRequest is a representation of a template request.
TemplateResponse is a representation of a set template response.
VerifyNumberRequest is a representation of a verify phone number request.
VerifyNumberResponse is a representation of a verify phone number response.
VerifyTokenRequest is a representation of a verify token request.
VerifyTokenResponse is a representation of a verify token response.