lark icon indicating copy to clipboard operation
lark copied to clipboard

Support for GetUserIDByEmail

Open jameschandra opened this issue 1 year ago • 1 comments
trafficstars

I believe this should be implemented in api-contact.go due to the current GetUserInfo only supporting open_id, union_id, and user_id, and not having support for search by email.

// GetUserIDByEmail fetches a user's information by their email using the batch_get_id endpoint
func (bot Bot) GetUserIDByEmail(email string) (*BatchGetIDByEmailResponse, error) {
	params := map[string]interface{}{
		"emails": []string{email},
	}
	var respData BatchGetIDByEmailResponse
	err := bot.PostAPIRequest("GetUserIDByEmail", batchGetIDByEmailURL, true, params, &respData)
	return &respData, err
}

jameschandra avatar Mar 01 '24 06:03 jameschandra

GetUserIDByEmail

Do you mean api_user.go of in-house version?

crispgm avatar Mar 01 '24 08:03 crispgm