Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Avatar to requestUser structure #112

Open
wants to merge 5 commits into
base: v2
Choose a base branch
from

Conversation

TE-tatuonagamatu
Copy link

This is pull request for resolving Issue: Setting avatar does not work

Avatar was added to User structure. But it is not in reqeustUser structure. Before posting /user API, User structure is converted to requestUser. Avatar is not defined in requestUser and not copied from User. So avatar setting is not work.

Avatar is added also for requestUser and copied from User.

@TE-tatuonagamatu
Copy link
Author

Checked with following code

package main

import (
	"fmt"

	intercom "github.com/intercom/intercom-go"
)

func main() {
	ic := intercom.NewClient("access_token", "")

	user := intercom.User{
		UserID: "5750790484393984",
		Email:  "[email protected]",
		Name:   "Tatsuo Nagamatsu",
		Avatar: &intercom.UserAvatar{Type: "avatar", ImageURL: "https://avatars2.githubusercontent.com/u/116613?v=4"},
	}
	savedUser, err := ic.Users.Save(&user)
	if err != nil {
		panic(err)
	}

	fmt.Println(savedUser.Avatar.String())
}

@TE-tatuonagamatu
Copy link
Author

TE-tatuonagamatu commented Mar 11, 2019

CustomAttributes are missing in UserCompany that holds information about belonging company. Add this fix to this PR. I created another PR #116 for CustomAttributes issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant