// Invite invites passed user to specified team.
//
// API doc: https://developers.miro.com/reference#invite-to-team
Invite invites passed user to specified team.


// Invite invites passed user to specified team . // // API doc : https : // developers . miro . com / reference#invite - to - team
func (s *TeamsService) Invite(ctx context.Context, id string, email string) ([]*TeamUserConnection, error) {
	req, err := s.client.NewPostRequest(fmt.Sprintf("%s/%s/%s/%s?email=%s", teamsPath, id, userConnectionsPath, teamInvitePath, email), nil)
	if err != nil {
		return nil, err
	}
	resp, err := s.client.Do(ctx, req)
	if err != nil {
		return nil, err
	}
	if resp.StatusCode != http.StatusOK {
		return nil, fmt.Errorf("status code not expected, got:%d", resp.StatusCode)
	}
	conns := []*TeamUserConnection{}
	if err := json.NewDecoder(resp.Body).Decode(&conns); err != nil {
		return nil, err
	}
	return conns, nil
}
func ( s * TeamsService ) Invite ( ctx context . Context , id string , email string ) ( [ ] * TeamUserConnection , error ) { req , err := s . client . NewPostRequest ( fmt . Sprintf ( " " , teamsPath , id , userConnectionsPath , teamInvitePath , email ) , nil ) if err != nil { return nil , err } resp , err := s . client . Do ( ctx , req ) if err != nil { return nil , err } if resp . StatusCode != http . StatusOK { return nil , fmt . Errorf ( " " , resp . StatusCode ) } conns := [ ] * TeamUserConnection { } if err := json . NewDecoder ( resp . Body ) . Decode ( & conns ) ; err != nil { return nil , err } return conns , nil }
Invite invites passed user to specified team.
Invite invites passed user to specified team .