Skip to content

tiabc/sms

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

58 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sms-rassilka.com client library

Go Report Card Build Status Coverage Status License: MIT GoDoc

The API documentation can be found at https://sms-rassilka.com/downloads/api/infocity-http-get.pdf.

Example

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.")
	}
}

License

MIT

Releases

No releases published

Packages

No packages published

Languages