Posting new users in Bulk

Comments

5 comments

  • Official comment
    Avatar
    Noam Gur

    Hi Delsaran,

    This is currently a limitation.  

    Possible workarounds:
    You can either: use POST api/v1/users
    and specifiy "activeDirectory": true,

    like this:

    {
      "email": "Ramatgan.user0094@ramatgan.int",
      "groups": [
        "5d4bfbe5bd3ef11b68180cef"
      ],
    "activeDirectory": true,
        "hash": null

    }

    Or you can create the users using the regular /user/ad/bulk, and then go over the ID's you are getting and make a second call to PATCH  users/{id} with the groups.
    Both options tested and worked.

    Hope this helps.

    Best,

    Noam

    Comment actions Permalink
  • Avatar
    Moti Granovsky

    Hi Delsaran - could you specify which API endpoint you are using, and in case the payload above isn't the full payload - attach that as well?

    0
    Comment actions Permalink
  • Avatar
    Delsaran Bigglesworth

    I'm using the /api/v1/users/ad/bulk endpoint, and yes that's the full payload or the desired payload. 

    [
    {
    "userName": "aadgreatest",
    "ldapDomainId": "5bnotab629d4af14fblahblaha"
    }
    ]

    ^^^ Works

    [
    {
    "userName": "aadgreatest",
    "groups": ["5ca61817c9e7612bb833d620"],
    "ldapDomainId": "5bnotab629d4af14fblahblaha"
    }
    ]

    ^^^ Doesn't work, even thought there is a key for it

    This is the suggested/example that is on the api page in Sisense

    [
      {
        "userName": "string",
        "roleId": "string",
        "groups": [
          "string"
        ],
        "objectSid": "string",
        "preferences": {
          "localeId": "Unknown Type: string,null"
        },
        "uiSettings": {}
      }
    ]
    0
    Comment actions Permalink
  • Avatar
    Moti Granovsky

    Thanks Delsaran, that's helpful. I noticed that the groups property does work for regular (non-AD) bulk user insert, so I suspect this is might be an issue for Sisense Support to investigate. I'll open a support ticket for you, hope that's OK.

    If you end up finding a solution of some sort (maybe a missing field or a mistake in field names in the documentation) please feel free to post it here for others to benefit from!

    1
    Comment actions Permalink
  • Avatar
    Delsaran Bigglesworth (Edited )

    That would be great if you'd do that for me. 

    Being able to set the group as I add the users would help count down on the code I have to write, if not i'd have to add the users and make another function to update the users. I'd rather do it all in one go. Will I be CC on this ticket?

    0
    Comment actions Permalink

Please sign in to leave a comment.