Skip to content

Fixing UsersClient.View when searching with parameters #153

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

SonnyCampbell
Copy link

Why?

/user?param=parameters enpoint returns a list of users, not a single user.

Because of this UsersClient.View is broken and always returns an object with all null values unless you search by id because /users/{id} is the endpoint that returns a single user.

How?

When querying by params (ie by user_id={user_id} or email={email}) return {resultObject}.users.FirstOrDefault() instead of {resultObject}

Investigate

I could only test this for the /users/email={email} endpoint, as our user_ids are empty, but I am assuming they work the same way.
Is /users/email={email} supposed to only return a single user? Is THAT the issue here? Or was that updated and the docs/packages werent?
https://developers.intercom.com/intercom-api-reference/reference#view-a-user

…users, so return users.FirstOrDefault from result
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