Implement POST /teams/{team_id}/invite/email for apiV4 (#5944)

Этот коммит содержится в:
Carlos Tadeu Panato Junior
2017-04-04 03:32:09 +02:00
коммит произвёл Joram Wilander
родитель d5f56e678a
Коммит 9dce502814
3 изменённых файлов: 91 добавлений и 0 удалений

Просмотреть файл

@@ -1057,6 +1057,16 @@ func (c *Client4) ImportTeam(data []byte, filesize int, importFrom, filename, te
return c.DoUploadImportTeam(c.GetTeamImportRoute(teamId), body.Bytes(), writer.FormDataContentType())
}
// InviteUsersToTeam invite users by email to the team.
func (c *Client4) InviteUsersToTeam(teamId string, userEmails []string) (bool, *Response) {
if r, err := c.DoApiPost(c.GetTeamRoute(teamId)+"/invite/email", ArrayToJson(userEmails)); err != nil {
return false, &Response{StatusCode: r.StatusCode, Error: err}
} else {
defer closeBody(r)
return CheckStatusOK(r), BuildResponse(r)
}
}
// Channel Section
// CreateChannel creates a channel based on the provided channel struct.