Problems using organization_memberships > create_many

6 Commentaires

  • Eric Nelson
    Zendesk Developer Advocacy
    Hey Ashley, 

    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 Adam 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:

    {
    "organization_memberships": [
    { "user_id": 12345, "organization_id": 9001 }
    ],
    [
    { "user_id": 67890, "organization_id": 9001 }
    ]
    }

    instead of one array with multiple objects, like this:

    {
    "organization_memberships": [
    { "user_id": 12345, "organization_id": 9001 },
    { "user_id": 67890, "organization_id": 9001 }
    ]
    }

    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:

    {
    "organization_memberships":[
    {
    "user_id":388246483398,
    "organization_id":360599321098
    },
    {
    "user_id":388246483398,
    "organization_id":360599321218
    },
    {
    "user_id":388246483398,
    "organization_id":360599321238
    },
    {
    "user_id":388246483398,
    "organization_id":360599321278
    },
    {
    "user_id":388246483398,
    "organization_id":360599321338
    }
    ]
    }
    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

    Hi Zendesk community,

    I am surprised that it doesn't works this way:

    {
        "organization_memberships": [
            {
                "user_id": 6281526325405,
              "organization_name": "name of an organization",
            }
        ]
    }

    but works this way:

     

    {
        "organization_memberships": [
            {
                "user_id": 6281526325405,
                "organization_id":  72762728292,
            }
        ]
    }

    Do you have a solution/work around please? :)

     

    Best regards,

    Raphaël (Solène GIACOMINI)

     

    0

Vous devez vous connecter pour laisser un commentaire.

Réalisé par Zendesk