Documentation on NewClient is unclear
The NewClient function currently accepts two parameters: appID and apiKey. If the user is using an API token, the appid and api token have to be passed in reverse order:
instead of calling
NewClient(appID,apitoken)
the correct way to use the library is to call
NewClient(apitoken,appID)
even if the function is declared with the following signature:
func NewClient(appID, apiKey string) *Client {
This is stated in the README.md, but conflicts with the current variable naming. Documentation on the NewClient function should be added or the names should be changed.
My code is something like this:
c := intercom.NewClient("my-access-token", "")
user, err := ic.Users.FindByUserID("807786")
fmt.Println(user)
fmt.Printf("INTERCOM GO \n")
fmt.Printf("%s \n", user.Email)
_ = err
However, it's returning a blank result like this:
[intercom] user { id: name: , user_id: , email: }
INTERCOM GO
I'm not sure why we cannot connect to intercom with latest api version of go, could you please take a look
I think I've also just stumbled on this. Seems like if we set the API version to 1.1 in the console then FindByEmail doesn't work anymore. It returns a blank email and no error.
The changelog for the API says that the find by email response type has changed so I assume this lib has to change to reflect that but then it would need to know what version of the API you are targeting.