Documentation ¶
Index ¶
Constants ¶
View Source
const ( //SingleMessagePath for sending a single message SingleMessagePath = "sms/1/text/single" //AdvancedMessagePath for sending advanced messages AdvancedMessagePath = "sms/1/text/advanced" )
Variables ¶
View Source
var ( // ErrForDestinationNonAlphanumeric ... ErrForDestinationNonAlphanumeric = Error{Err: "non-alphanumeric 'Destination' value must be between 3 and 14 numbers"} // ErrForFromNonAlphanumeric ... ErrForFromNonAlphanumeric = Error{Err: "non-alphanumeric 'From' value must be between 3 and 14 numbers"} // ErrForFromAlphanumeric ... ErrForFromAlphanumeric = Error{Err: "alphanumeric 'From' value must be between 3 and 13 characters"} // ErrForToNonAlphanumeric ... ErrForToNonAlphanumeric = Error{Err: "non-alphanumeric 'To' value must be between 3 and 14 numbers"} )
Functions ¶
This section is empty.
Types ¶
type BulkMessage ¶
type BulkMessage struct { ID string `json:"bulkId,omitempty"` Messages []Message `json:"messages"` }
BulkMessage contains the body request for multiple messages
func (BulkMessage) Validate ¶
func (b BulkMessage) Validate() (err error)
Validate validates the entire message values
type Client ¶
type Client struct { BaseURL string Username string Password string HTTPClient HTTPInterface }
Client manages requests to Infobip
func ClientWithBasicAuth ¶
ClientWithBasicAuth returns a pointer to infobip.Client with Infobip funcs
func (Client) AdvancedMessage ¶
func (c Client) AdvancedMessage(m BulkMessage) (r Response, err error)
AdvancedMessage sends messages to the recipients
type Destination ¶
Destination contains the recipient
type HTTPInterface ¶
HTTPInterface helps Infobip tests
type Message ¶
type Message struct { From string `json:"from,omitempty"` Destinations []Destination `json:"destinations,omitempty"` To string `json:"to,omitempty"` Text string `json:"text"` Transliteration string `json:"transliteration,omitempty"` LanguageCode string `json:"languageCode,omitempty"` }
Message contains the body request
type Response ¶
type Response struct { BulkID string `json:"bulkId,omitempty"` Messages []ResponseMessage `json:"messages"` }
Response body response
type ResponseMessage ¶
type ResponseMessage struct { ID string `json:"messageId"` To string `json:"to"` Status ResponseStatus `json:"status"` SMSCount int `json:"smsCount"` }
ResponseMessage ...
Click to show internal directories.
Click to hide internal directories.