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

Users.FindByEmail > unmarshallTouser() method error. #125

Closed
msueiro opened this issue Nov 27, 2019 · 1 comment
Closed

Users.FindByEmail > unmarshallTouser() method error. #125

msueiro opened this issue Nov 27, 2019 · 1 comment

Comments

@msueiro
Copy link

msueiro commented Nov 27, 2019

There is a bug when Users.FindByEmail method response unmarshall is called .

Version info

  • intercom-go version: v2
  • Go version: 1.12

Expected behavior

I'm expecting to receive a User{} initialized with all the data collected from api.httpClient.Get("/users", params) (user_api.go line 55)

Actual behavior

In this case when I find by email the api response is a UserList{} instead a User{}.
The unmarshallToUser() method is expecting a []byte that represents the User{} struct but the input in this case is an UserList{}

The result is that a receive a User{} empty struct.

Steps to reproduce

  1. Call Users.FindByEmail method with a valid email
  2. The response will be an empty User{} struct
  3. If you debug the method the []byte response will be an UserList{}
@lloydliyu
Copy link

Hey @msueiro 👋

The GO SDK is currently only compatible with version 1.0 of the Intercom API. Since version 1.1 of the API, the API will return a list of users who match that email address, which the SDK isn't expecting.

This should however still work if the App is set to use version 1.0 of the API. If you need any help adjusting the version within the developer hub, I'd recommend reaching out to the support team using the Messenger at https://intercom.com.

Closing this out as a duplicate to #130

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

No branches or pull requests

2 participants