"Error saving user: Multiple organizations were provided. Only one or none is accepted."

10 Comentários

  • Simon Blouner
    Ações de comentário Permalink

    Hey Aaron,

    This sounds like you're not able to have users in multiple organisations.

    This is restricted for the license plans Professional and Enterprise.

    If you are on one of these plans, you can check if the setting is activated under Admin -> Settings -> Customers and look if the Allow users to belong in multiple organisations are checked.

    Let me know is this could be the reason :-)

    #helpsome regards,
    Simon Blouner
    Zendesk Consultant @ helphouse.io

     

    0
  • Aaron
    Ações de comentário Permalink

    Good Morning Simon,

    We have that option and I have tested the API upload with that setting enabled and it works. However, instead of replacing the Organization that was there with the new one being uploaded it, it adds the organization so that the user now has 2 organizations assigned. That is what we do not want. We want all users to have a single organization assigned and when their job changes and they move to another organization, we’d like for that existing organization to be replaced with the new one as they would have no more business with the old organization.

     

    Aaron

    0
  • Brett - Community Manager
    Ações de comentário Permalink

    Hey Aaron,

    Any chance you could provide us with the API call you're making so we can take a look?

    Thanks in advance!

    0
  • Simon Blouner
    Ações de comentário Permalink

    Hey Aaron,

    As Brett suggests it would be easier for us to take you further if you could provide us with your API call :-)

    0
  • Aaron
    Ações de comentário Permalink

    Thanks guys,

    Here is the call:

    https://xxxxxxxxxx.zendesk.com/api/v2/users/create_or_update_many.json ^ -d @"\\xxxxxxx\xxxxxxx\ZenDesk\xxxxxxx_BulkUserImport.txt" ^ -H "Content-Type: application/json" -X POST ^ -v -u xxxxxxx@email.com/token:xxxxxxx

    -----------------------------------------------------------------------------------------

    Here is what a middle line from the .txt looks like:

    {"name":"Dohn Joe","email":"Dhon.Joe@email.com","external_id":"1234567","phone":"555-555-5555","role":"End-user","restriction":"Assigned","organization":{"name":"MOES BAR"}},

    -----------------------------------------------------------------------------------------

    The users create properly and all info is assigned. It's just the replacing the default site when it changes that we're having issues with.

    Thanks!

    Aaron

     

     

    0
  • Simon Blouner
    Ações de comentário Permalink

    Hey Aaron,

    To me your code looks fine.

    I'm now thinking two things could fix this, but I'm not 100% on these:
    - Are you importing/updating more than a 100 users?
    - Have you tried using organization_id instead?

     

    1
  • Aaron
    Ações de comentário Permalink

    Yes, I tried that as well with no luck. Is what I'm trying to do even possible? Are there other methods/commands? Like maybe instead of saying "DefaultOrganization" or something similar in the JSON, for example? I don't see anything like that in the documentation but, maybe I just missed it and it's a simple solution.

     

    Aaron

    0
  • Brett - Community Manager
    Ações de comentário Permalink

    Hey Aaron,

    I'm going to bring this into a ticket so our Customer Advocacy team can take a look at this for you.

    You'll receive a follow-up email shortly stating your ticket has been created.

    Cheers!

    0
  • Aaron
    Ações de comentário Permalink

    Thanks All,

    I got it resolved! For those that have this issue in the future, this is what I did:

    I used the /api/v2/organizations.json API to get the list of all the Organization IDs that were created by Zendesk for each Org and created a table on my database. I then changed my query to use the Organization_ID for each update and it worked like a charm.

    When Simon originally suggested this, for some reason, I assumed it was to use our own Org IDs and that was way off.

    Aaron

    0
  • Brett - Community Manager
    Ações de comentário Permalink

    Thanks for taking the time to share this with everyone Aaron!

    0

Por favor, entrar para comentar.

Desenvolvido por Zendesk