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

Change the User documentation/code to take user_id as an argument, rather than ID, as well as adding email. #58

Closed
Sebbenbear opened this issue Nov 19, 2015 · 3 comments

Comments

@Sebbenbear
Copy link

Firstly, thanks for writing a sweet API!
Secondly, the following code would be very useful and not difficult to implement:

//Find user by id
client.users.find({ id: '1234' }, callback);

would be better represented as:

//Find user by id
(client.users.find({ user_id: '1234' }, callback);

as this would be less misleading. This would not be a difficult fix either and would be much more practical to use.

As well as the above issue, the following would be extremely useful:

// Find user by email
client.users.find({ email: '1234@gmail.com' }, callback);

It could be implemented in user.js using:

client.get('/users/?email=${email}', {}, callback);

Cheers!

@bobjflong
Copy link
Contributor

Hi @Sebbenbear !

I think I will add more finds today. However just wanted to point something out:

client.users.find({ id: '1234' }, callback);

is different to:

client.users.find({ user_id: '1234' }, callback);

id is set automatically by Intercom. It is the primary key for the resource you are saving. user_id is an optional identifier you can set. Often people store their own database ids in there. More info here.

@bobjflong
Copy link
Contributor

More finds in 2.2.0: https://github.com/intercom/intercom-node#users.

Thanks!

@Sebbenbear
Copy link
Author

Ah, I see - good point. Thanks for taking the time to do that :) Cheers.

fern-bot pushed a commit that referenced this issue Jul 17, 2024
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