Documentation
¶
Overview ¶
Package turbosms is a client for the legacy TurboSMS SOAP gateway.
SOAP is the legacy TurboSMS protocol. For new projects consider the current HTTP API: https://turbosms.ua/en/api.html
Index ¶
- type Client
- func (c *Client) GetCreditBalance() (*wsdl.GetCreditBalanceResponse, error)
- func (c *Client) GetMessageStatus(msgId string) (*wsdl.GetMessageStatusResponse, error)
- func (c *Client) GetNewMessages() (*wsdl.GetNewMessagesResponse, error)
- func (c *Client) SendSMS(sender string, destination string, text string, wappush string) (*wsdl.SendSMSResponse, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
SoapService *wsdl.ServiceSoap
// Debug enables logging of raw SOAP requests and responses.
Debug bool
}
Client is a TurboSMS SOAP gateway client. Create it with NewClient.
func NewClient ¶
NewClient returns a Client that talks to the official TurboSMS SOAP endpoint using the given gateway credentials.
func (*Client) GetCreditBalance ¶
func (c *Client) GetCreditBalance() (*wsdl.GetCreditBalanceResponse, error)
GetCreditBalance returns the current account balance in credits.
func (*Client) GetMessageStatus ¶
func (c *Client) GetMessageStatus(msgId string) (*wsdl.GetMessageStatusResponse, error)
GetMessageStatus returns the delivery status of the message with the given id.
func (*Client) GetNewMessages ¶
func (c *Client) GetNewMessages() (*wsdl.GetNewMessagesResponse, error)
GetNewMessages returns new incoming messages.
func (*Client) SendSMS ¶
func (c *Client) SendSMS(sender string, destination string, text string, wappush string) (*wsdl.SendSMSResponse, error)
SendSMS sends a text message to the destination phone number.
The gateway reports message level failures, for example not enough credits, as strings inside SendSMSResult. In this case the returned error is nil, so always check the result strings.