The API documentation can be found at https://sms-rassilka.com/downloads/api/infocity-http-get.pdf.
package main
import (
"fmt"
"github.com/tiabc/sms"
)
func main() {
// Create a sender with your login and MD5-hashed password.
s := sms.Sender{
Login: "+7 999 888-77-66",
PasswordMD5: "fd494182a7ee16ae07f641c7c03663d8",
}
// Use any of SendSMS methods to send an SMS.
res, err := s.SendSMS("+7 999 000-00-00", "Hello world!")
if err != nil {
panic(err)
}
// Query the delivery status of the just sent SMS.
ds, err := s.QueryStatus(res.SMSID)
if err != nil {
panic(err)
}
// Process the delivery status.
switch {
case ds.IsInProgress():
fmt.Println("Queued.")
case ds.IsDelivered():
fmt.Println("Delivered.")
case ds.IsUndelivered():
fmt.Println("Undelivered.")
}
}
MIT