Documentation ¶
Index ¶
- Constants
- type FetchMessageResponse
- type FetchSubscriptionResponse
- type Message
- type Recipient
- type SMS
- type SMS2
- type SendMessageResponse
- type Service
- func (service Service) CreateSubscription(username, shortCode, keyword, phoneNumber, checkoutToken string) (*SubscriptionResponse, error)
- func (service Service) FetchMessage(username, lastReceivedID string) (*FetchMessageResponse, error)
- func (service Service) FetchSubscription(username, shortCode, keyword, lastReceivedID string) (*FetchSubscriptionResponse, error)
- func (service Service) Send(from, to, message string) (*SendMessageResponse, error)
- func (service Service) SendBulk(from, to, message string, bulkMode int, enqueue string) (*SendMessageResponse, error)
- func (service Service) SendBulkToMany(from, message string, to []string, bulkMode int, enqueue string) (*SendMessageResponse, error)
- func (service Service) SendPremium(username, to, from, message, keyword, linkID, retryDurationInHours string, ...) (*SendMessageResponse, error)
- func (service Service) SendToMany(from, message string, to []string) (*SendMessageResponse, error)
- type Subscription
- type SubscriptionResponse
Constants ¶
View Source
const ( Sandbox = "sandbox" Prod = "production" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FetchMessageResponse ¶
type FetchMessageResponse struct {
SMS SMS `json:"SMSMessageData"`
}
FetchMessageResponse is a model
type FetchSubscriptionResponse ¶
type FetchSubscriptionResponse struct {
Subscriptions []Subscription
}
FetchSubscriptionResponse is a model
type Message ¶
type Message struct { From string `json:"from"` To string `json:"to"` Text string `json:"text"` LinkID string `json:"linkId"` Date string `json:"date"` ID int64 `json:"id"` }
Message is a model
type Recipient ¶
type Recipient struct { Number string `json:"number"` Cost string `json:"cost"` Status string `json:"status"` MessageID string `json:"messageId"` }
Recipient is a model
type SendMessageResponse ¶
type SendMessageResponse struct {
SMS SMS2 `json:"SMSMessageData"`
}
SendMessageResponse is a model
type Service ¶
Service is a model
func NewService ¶
NewService returns a new service
func (Service) CreateSubscription ¶
func (service Service) CreateSubscription(username, shortCode, keyword, phoneNumber, checkoutToken string) (*SubscriptionResponse, error)
CreateSubscription - POST
func (Service) FetchMessage ¶
func (service Service) FetchMessage(username, lastReceivedID string) (*FetchMessageResponse, error)
FetchMessage - username = query
func (Service) FetchSubscription ¶
func (service Service) FetchSubscription(username, shortCode, keyword, lastReceivedID string) (*FetchSubscriptionResponse, error)
FetchSubscription - query
func (Service) Send ¶
func (service Service) Send(from, to, message string) (*SendMessageResponse, error)
Send - POST
func (Service) SendBulk ¶
func (service Service) SendBulk(from, to, message string, bulkMode int, enqueue string) (*SendMessageResponse, error)
SendBulk - POST
func (Service) SendBulkToMany ¶
func (service Service) SendBulkToMany(from, message string, to []string, bulkMode int, enqueue string) (*SendMessageResponse, error)
SendBulkToMany is a utility method to send to many recipients at the same time
func (Service) SendPremium ¶
func (service Service) SendPremium(username, to, from, message, keyword, linkID, retryDurationInHours string, bulkMode int) (*SendMessageResponse, error)
SendPremium - POST
func (Service) SendToMany ¶
func (service Service) SendToMany(from, message string, to []string) (*SendMessageResponse, error)
SendToMany is a utility method to send to many recipients at the same time
type Subscription ¶
type Subscription struct { ID int64 `json:"id"` PhoneNumber string `json:"phoneNumber"` Date string `json:"date"` }
Subscription is a model
type SubscriptionResponse ¶
type SubscriptionResponse struct { Success string `json:"success"` Description string `json:"description"` }
SubscriptionResponse is a model
Click to show internal directories.
Click to hide internal directories.