Skip to content
This repository has been archived by the owner on Aug 3, 2019. It is now read-only.
/ ghasedakapi-go Public archive

ghasedakapi golang sdk [legacy] [deprecated] [archived]

Notifications You must be signed in to change notification settings

ghasedakapi/ghasedakapi-go

Repository files navigation

ghasedakapi-go

Ghasedakapi Go library

Installation

go get github.com/ghasedakapi/ghasedakapi-go

How to use?

On the import section of your Go project:

import ( ... "github.com/ghasedakapi/ghasedakapi-go" ... )

Usage

send SMS

package main
import(
"fmt"
"github.com/ghasedakapi/ghasedakapi-go"
)
const (
  ApiKey  = "your apikey"
)
func main(){
c := ghasedakapi.New(ApiKey)
  lineNumber := "sender number"                 
  receptor := []string{"receptor1","receptor2"}
  message := "test message" 
  if res, err:= c.SMS.Send( message,lineNumber, receptor); err != nil {
  	fmt.Println(err)
  	} else {
  		for _, r := range res.Items {
  			fmt.Println(r)
  		}
  }
}

get account information

 package main
 import(
   "fmt"
   "github.com/ghasedakapi/ghasedakapi-go"
 )
 const (
     ApiKey  = "your apikey"
 )
 func main(){
   c := ghasedakapi.New(ApiKey)
     if result, err:= c.Account.GetInfo(); err != nil {
   		fmt.Println(err)
   	}
     else {
   	fmt.Println(result.Items.Balance)	
   	fmt.Println(result.Items.Expire)	
   }
}

About

ghasedakapi golang sdk [legacy] [deprecated] [archived]

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages