Recent searches
No recent searches
Problems using organization_memberships > create_many
Posted Jan 25, 2022
I'm trying to send a POST request to /api/v2/organization_memberships/create_many but always get this response:
error: TooManyValues
description: Parameter organization_memberships cannot specify more than 1 values
max_count: 1
Which seems odd for a create_many endpoint. The request body is
{
"organization_memberships": [
{
"user_id":388246483398,
"organization_id":360606612137
}
]
}
Just wondering if anyone has seen this before, and have any ideas what the problem might be? Any help would be most appreciated.
0
6
6 comments
Eric Nelson
That's quite odd, in your request body I'm only seeing one membership listed. In your actual response are you including more than one object in that array?
0
Ashley Johnson
Sorry, I was trying to show the format, but made it confusing.
If I send one membership in the body, it appears to work. If I send more than one membership, I get that error.
0
Jason Littrell
Hey Ashley Johnson,
Based on the error description, I'm guessing that the "organization_memberships" parameter has more than one array, like this maybe:
instead of one array with multiple objects, like this:
If that isn't the case, though, could you post a sample of the full JSON payload that triggers the error?
0
Ashley Johnson
Thanks Jason, I've just tested with this:
0
Ashley Johnson
The solution to this problem was that Zendesk has an admin option called enable multiple organisations for users which is not enabled by default. That API error message isn't clear, but enabling this option allowed me to add the organisation memberships.
0
Raphaël Péguet - Officers.fr
Hi Zendesk community,
I am surprised that it doesn't works this way:
but works this way:
Do you have a solution/work around please? :)
Best regards,
Raphaël (Solène OFFICERS)
0