diff options
Diffstat (limited to 'model/client.go')
-rw-r--r-- | model/client.go | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/model/client.go b/model/client.go index 48a560838..4d2c49e70 100644 --- a/model/client.go +++ b/model/client.go @@ -416,6 +416,15 @@ func (c *Client) TestEmail(config *Config) (*Result, *AppError) { } } +func (c *Client) GetAnalytics(teamId, name string) (*Result, *AppError) { + if r, err := c.DoApiGet("/admin/analytics/"+teamId+"/"+name, "", ""); err != nil { + return nil, err + } else { + return &Result{r.Header.Get(HEADER_REQUEST_ID), + r.Header.Get(HEADER_ETAG_SERVER), AnalyticsRowsFromJson(r.Body)}, nil + } +} + func (c *Client) CreateChannel(channel *Channel) (*Result, *AppError) { if r, err := c.DoApiPost("/channels/create", channel.ToJson()); err != nil { return nil, err |