Documentation ¶
Overview ¶
Package messagebird is an official library for interacting with MessageBird.com API. The MessageBird API connects your website or application to operators around the world. With our API you can integrate SMS, Chat & Voice. More documentation you can find on the MessageBird developers portal: https://developers.messagebird.com/
Index ¶
Constants ¶
const ( // ClientVersion is used in User-Agent request header to provide server with API level. ClientVersion = "5.1.0" // Endpoint points you to MessageBird REST API. Endpoint = "https://rest.messagebird.com" )
Variables ¶
var ( // ErrUnexpectedResponse is used when there was an internal server error and nothing can be done at this point. ErrUnexpectedResponse = errors.New("The MessageBird API is currently unavailable") )
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { AccessKey string // The API access key HTTPClient *http.Client // The HTTP client to send requests on DebugLog *log.Logger // Optional logger for debugging purposes }
Client is used to access API with a given key. Uses standard lib HTTP client internally, so should be reused instead of created as needed and it is safe for concurrent use.
type Error ¶
Error holds details including error code, human readable description and optional parameter that is related to the error.
type ErrorResponse ¶
type ErrorResponse struct {
Errors []Error `json:"errors"`
}
ErrorResponse represents errored API response.
func (ErrorResponse) Error ¶
func (r ErrorResponse) Error() string
Error implements error interface.