internal

package
v1.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 31, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API struct {

	// APIURL defines base of API endpoint (without version, component and action).
	APIURL string
	// contains filtered or unexported fields
}

API provides the base client for making requests to Livechat Web APIs.

func NewAPI

func NewAPI(t authorization.TokenGetter, client *http.Client, clientID, name string) (*API, error)

NewAPI returns ready to use raw API client. This is a base that is used internally by specialized clients for each API, you should use those instead

If provided client is nil, then default http client with 20s timeout is used.

func (*API) Call

func (a *API) Call(action string, reqPayload interface{}, respPayload interface{}) error

Call sends request to API with given action

func (*API) UploadFile

func (a *API) UploadFile(filename string, file []byte) (string, error)

UploadFile uploads a file to LiveChat CDN. Returned URL shall be used in call to SendFile or SendEvent or it'll become invalid in about 24 hours. UploadFile is supported only in Agent and Customer API

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL