Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶
type Client struct { SenderNumber string // contains filtered or unexported fields }
Client is a twilio client
func ClientFromClient ¶
ClientFromClient will create a twilio client that uses a user given http.Client.
func (*Client) Send ¶
func (c *Client) Send(to, body string) (*MessageResponse, error)
Send will a message given the recipient's phone number.
type Error ¶
type Error struct { Code int `json:"code"` Message string `json:"message"` MoreInfo string `json:"more_info"` Status int `json:"status"` }
Error is a twilio response error
type MessageResponse ¶
type MessageResponse struct { Sid string `json:"sid"` DateCreated string `json:"date_created"` DateUpdated string `json:"date_updated"` DateSent interface{} `json:"date_sent"` AccountSid string `json:"account_sid"` To string `json:"to"` From string `json:"from"` MessagingServiceSid interface{} `json:"messaging_service_sid"` Body string `json:"body"` Status string `json:"status"` NumSegments string `json:"num_segments"` NumMedia string `json:"num_media"` Direction string `json:"direction"` APIVersion string `json:"api_version"` Price interface{} `json:"price"` PriceUnit string `json:"price_unit"` ErrorCode interface{} `json:"error_code"` ErrorMessage interface{} `json:"error_message"` URI string `json:"uri"` SubresourceUris struct { Media string `json:"media"` } `json:"subresource_uris"` }
MessageResponse is the json response given from sending a message.
func Send ¶
func Send(to, body string) (*MessageResponse, error)
Send will a message given the recipient's phone number.
func SendFrom ¶
func SendFrom(from, to, body string) (*MessageResponse, error)
SendFrom will send a message given the sender's number and the recipient's number.
Click to show internal directories.
Click to hide internal directories.