Files
smsc/sms.go
2026-02-03 21:42:44 +03:00

26 lines
456 B
Go

package smsc
const (
UrlSMS = "https://smsc.ru/rest/send/"
)
type RequestSMS struct {
ApiKey string `json:"apikey"`
Phone string `json:"phones"`
Message string `json:"mes"`
Sender string `json:"sender,omitempty"`
}
type ResponseSMS struct {
Response
ID int `json:"id"`
Cnt int `json:"cnt"`
}
func SendSMS(req RequestSMS) (resp ResponseSMS) {
if err := requestPost(UrlSMS, req, &resp); err != nil {
resp.Error = err.Error()
}
return
}