Documentation
¶
Overview ¶
Package mojo is a client to the Mojo API
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Contact ¶
type Contact struct { ID string // required GroupID int // required Name string Address, City, State, Zip string Email string MobilePhone, WorkPhone, HomePhone string Notes []string }
Contact to be created in Mojo
Either Name must provided OR at least one of Email, MobilePhone, WorkPhone, HomePhone
func (Contact) MarshalJSON ¶
type ErrDuplicate ¶
type ErrDuplicate struct {
IDs []string
}
ErrDuplicate is returned by AddContact when a contact with same id already exists in Mojo
func (*ErrDuplicate) Error ¶
func (e *ErrDuplicate) Error() string
type ErrForbidden ¶
type ErrForbidden struct {
Msg string
}
ErrForbidden is returned on status code 403, usually due to invalid access token
func (*ErrForbidden) Error ¶
func (e *ErrForbidden) Error() string
type ErrInvalid ¶
type ErrInvalid struct {
Msg string
}
ErrInvalid is returned by AddContact when a validation error is detected, like missing a required field
func (*ErrInvalid) Error ¶
func (e *ErrInvalid) Error() string
type Mojo ¶
type Mojo struct { // URL for this account, including protocol + host, example: // https://posttest.mojosells.com // // Each mojo client has their own url URL string // Token is the access token provided by Mojo after the client // has logged in using OAuth Token string HTTP *http.Client // (optional) http client to perform requests }
Mojo client
func (*Mojo) AddContact ¶
AddContact creates a new Contact in Mojo
Contact ID and GroupID must be provided. At least one contact field should be provided
Return ErrDuplicate if a contact with same ID already exists. Return other errors if can't make the request of if Mojo returns an error