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
Support show_many for Users #107
Comments
Can you tell me a bit more about what you are trying to achieve? If you just want to iterate over all users you can just call the for user in zenpy_client.users():
print user Retrieving users by id can be done individually: user = zenpy_client.users(id=19979184587) If you only want to retrieve some subset of users by id in a single API call that is not currently implemented, although it is most likely not difficult to do. |
In this case, I had around data from an good data csv export around 80'000 user ids, that I wanted to match against user emails, since only user ids are present in data warehouse for PII reasons. My options as I see it, is either exportering all the users from the Zendesk account using incremental export, then store them somewhere, and match against my list of user ids against this data set, or to make a number of calls to retrieve every single user directly (making it a one step process instead). Since it was quite a few users, I thought I might use the show_many endpoint since it allows up to 100 users to be retrieved with each call. i.e. I would make 800 API requests instead of 80'000, which seemed like a good thing. |
Makes sense. The incremental endpoints return 1000 items per call which might work out fastest overall depending on how many users you have in your Zendesk. In any case, I can look to implement this when I get the chance as it does seem like a handy feature. |
That would be great. I love this library, and actually got into python over the weekend just for this. |
No worries, glad you like it! |
Hi @joelhellman, I just went to implement this and it turns out it is already implemented. You can access this functionality as follows: for user in zenpy_client.users(ids=[21207616708, 21214060148]):
print(user) Sorry I should have done a but more investigation when you first opened the ticket! |
Excellent! Thanks for the update. That's really useful, and I would love to see it added to the docs :) |
No worries, yes I'll add it to the docs. |
Can I use this library to make a request to GET
/api/v2/users/show_many.json?ids=1,2,3
and how?The text was updated successfully, but these errors were encountered: