We can consume Citcall API using this library. You need Citcall Apikey and your IP has been whitelisted. Please refer to official Citcall documentation for more detail.
go get github.com/danielwetan/citcallgo
Import the library in project file
import "github.com/danielwetan/citcallgo"
Create a new instance with your Citcall Apikey
citcall := citcallgo.New("API_KEY")
package main
import (
"context"
"fmt"
"github.com/danielwetan/citcallgo"
)
func main() {
citcall := citcallgo.New("API_KEY")
requestBody := citcallgo.MisscallOtpRequest{
Msisdn: "6281234567890",
Gateway: 0,
}
res, err := citcall.SendMisscall(context.Background(), &requestBody)
if err != nil {
fmt.Println("Error")
fmt.Println(err)
}
fmt.Println(res)
}
package main
import (
"context"
"fmt"
"github.com/danielwetan/citcallgo"
)
func main() {
citcall := citcallgo.New("API_KEY")
requestBody := citcallgo.SMSRequest{
Msisdn: "6281234567890",
SenderId: "xxxxx",
Text: "hello",
}
res, err := citcall.SendSMS(context.Background(), &requestBody)
if err != nil {
fmt.Println("Error")
fmt.Println(err)
}
fmt.Println(res)
}
package main
import (
"context"
"fmt"
"github.com/danielwetan/citcallgo"
)
func main() {
citcall := citcallgo.New("API_KEY")
requestBody := citcallgo.SMSOTPRequest{
Msisdn: "6281234567890",
SenderId: "xxxxx",
Text: "hello",
}
res, err := citcall.SendSMSOTP(context.Background(), &requestBody)
if err != nil {
fmt.Println("Error")
fmt.Println(err)
}
fmt.Println(res)
}
- You can find a bug or issue in this page Github Issues
- Pull this repository
- Make a change
- Send a pull request with clear commit message