Documentation ¶
Index ¶
- func CheckResponse(r *http.Response) error
- type AuthError
- type Call
- type CallAnsweredBy
- type CallFromContact
- type CallsListOptions
- type CallsService
- type Client
- type Employee
- type EmployeesService
- func (s *EmployeesService) All() ([]*Employee, *Response, error)
- func (s *EmployeesService) Authenticated() (*Employee, *Response, error)
- func (s *EmployeesService) GetById(id int) (*Employee, *Response, error)
- func (s *EmployeesService) SendSMS(e *Employee, msg string) (*firmafonSMSResponse, *Response, error)
- func (s *EmployeesService) Update(e *Employee) (*Employee, *Response, error)
- type ErrorResponse
- type Response
- type SpeedDial
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckResponse ¶
Types ¶
type AuthError ¶
type AuthError ErrorResponse
type Call ¶
type Call struct { CallUUID string `json:"call_uuid"` CompanyID int `json:"company_id"` Endpoint string `json:"endpoint"` FromNumber string `json:"from_number"` ToNumber string `json:"to_number"` FromContact *CallFromContact `json:"from_contact"` ToContact interface{} `json:"to_contact"` Direction string `json:"direction"` StartedAt time.Time `json:"started_at"` AnsweredAt time.Time `json:"answered_at"` AnsweredBy *CallAnsweredBy `json:"answered_by"` EndedAt time.Time `json:"ended_at"` Status string `json:"status"` }
type CallAnsweredBy ¶
type CallFromContact ¶
type CallsListOptions ¶
type CallsListOptions struct { Endpoint string `url:"endpoint"` Direction string `url:"direction"` Status string `url:"status"` Number string `url:"number"` Limit string `url:"limit"` StartedAtGtOrEq string `url:"started_at_gt_or_eq"` StartedAtLtOrEq string `url:"started_at_lt_or_eq"` EndedAtGtOrEq string `url:"ended_at_gt_or_eq"` EndedAtLtOrEq string `url:"ended_at_lt_or_eq"` }
type CallsService ¶
type CallsService struct { Endpoint string // contains filtered or unexported fields }
func (*CallsService) GetAll ¶
func (s *CallsService) GetAll(opt *CallsListOptions) ([]*Call, *Response, error)
GetAll returns a slice of calls to or from one or more numbers
type Client ¶
type Client struct { AccessToken string BaseURL *url.URL // Services used for talking to different parts of the Firmafon API Employees *EmployeesService Calls *CallsService // contains filtered or unexported fields }
A Client manages communication with the Firmafon API.
type Employee ¶
type Employee struct { Admin bool `json:"admin,omitempty"` CloakReception interface{} `json:"cloak_reception,omitempty"` CompanyID int `json:"company_id,omitempty"` DndTimeoutAt *time.Time `json:"dnd_timeout_at,omitempty"` DoNotDisturb bool `json:"do_not_disturb,omitempty"` EmployeeGroupIds []int `json:"employee_group_ids,omitempty"` Features []string `json:"features,omitempty"` ID int `json:"id,omitempty"` LivePresence string `json:"live_presence,omitempty"` Name string `json:"name,omitempty"` Number string `json:"number,omitempty"` SpeedDial *SpeedDial `json:"speed_dial,omitempty"` }
type EmployeesService ¶
type EmployeesService service
func (*EmployeesService) All ¶
func (s *EmployeesService) All() ([]*Employee, *Response, error)
All returns a slice of all employees
func (*EmployeesService) Authenticated ¶
func (s *EmployeesService) Authenticated() (*Employee, *Response, error)
Authenticated returns the currently authenticated employee.
func (*EmployeesService) GetById ¶
func (s *EmployeesService) GetById(id int) (*Employee, *Response, error)
GetById returns the employee with the specified ID
func (*EmployeesService) SendSMS ¶
func (s *EmployeesService) SendSMS(e *Employee, msg string) (*firmafonSMSResponse, *Response, error)
Send an SMS message to the given employee. The sender will be shown as either the authenticated employee’s number or name. Beware these are cheap, but not free see https://www.firmafon.dk/prisliste This feature is not available for companies in trial.
type ErrorResponse ¶
type ErrorResponse struct { Response *http.Response Status string `json:"status"` // error message returned from api Message string `json:"message"` // error message returned from api }
func (*ErrorResponse) Error ¶
func (r *ErrorResponse) Error() string
Click to show internal directories.
Click to hide internal directories.