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

Update Many Users like describe in example doesn't work #405

Open
avarennes opened this issue Jan 25, 2024 · 3 comments
Open

Update Many Users like describe in example doesn't work #405

avarennes opened this issue Jan 25, 2024 · 3 comments

Comments

@avarennes
Copy link

* const updatedUsers = await client.users.updateMany([12345, 67890], [{name: 'John Doe'}, {name: 'Jane Smith'}]);

Hi,

When I use client.users.updateMany like the exemple I've got 400 error.

I managed to use this method with args below

await client.users.updateMany({ ids: [123456].join(''), user: { tags: ["my_tag"] } }, [])

I don't think this is the good way to use this method. Maybe a bug in this method...

Please, give me answer about that.

Thx

@ngouy
Copy link
Contributor

ngouy commented Dec 19, 2024

Had the same issue with createOrUpdate many

Give it a try without any ids, using users instead of user and provide it an array of elements including id or external id

await client.users.updateMany({ users: [{ id: 123456 , tags: ["my_tag"] }] }, []) // not sure what the trailing [] is for

@blakmatrix
Copy link
Owner

Hi @ngouy and @avarennes,

Thank you both for your comments and for actively engaging with the library! I’m trying to fully understand the issue here, but things feel a bit unclear to me. It seems like there might be a mismatch between the JSDoc example and the actual code usage for client.users.updateMany.

To make sure we're on the same page, could you clarify:

What’s the expected behavior based on the documentation or JSDoc?
What behavior are you currently seeing (e.g., the 400 error)?
Is there a specific part of the JSDoc example or the method implementation you think is incorrect?
I want to ensure things are working as intended, but it's possible things have drifted due to recent updates while fixing other issues.

Your insights would really help me get to the bottom of this!

Thanks,
Farrin

@ngouy
Copy link
Contributor

ngouy commented Dec 20, 2024

IDK
I just found that api docs of zendesk aren't great overall had to do a lot of trial and error
On my end, ended up using raw query for create_update_many because i don't provide any user ids, just full users objects, and zendesk does the job of doing an upsert based on external_id

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

3 participants