Automatic user creation camunda

Hello,
I have to create a total of 300 users in camunda with default password and default group. Is it possible via SQL Query or REST API ?
Have you some example ?

Thanks

Hi @oronzo_lezzi,

this is the REST Api call to create a user: https://docs.camunda.org/manual/7.12/reference/rest/user/post-create/

And with this call you can add the user to a group: https://docs.camunda.org/manual/7.12/reference/rest/group/members/put/.

If you put these requests into a client of your choice and add a loop around it you can easly create 300 users.

Hope this helps, Ingo

1 Like

Thank you @Ingo_Richtsmeier

Hello I have try the API to PUT members in GROUP

/group/sales/members/jonny1

but I have this error on my CAMUNDA installation with Oracle installation as DB

{
“type”: “ProcessEngineException”,
“message”: “ENGINE-03004 Exception while executing Database Operation ‘INSERT MembershipEntity[4d709e6d-7a50-11ea-931e-005056b04c95]’ with message ‘\n### Error updating database. Cause: java.lang.NullPointerException\n### The error may involve org.camunda.bpm.engine.impl.persistence.entity.MembershipRelation.insertMembership-Inline\n### The error occurred while setting parameters\n### SQL: insert into ACT_ID_MEMBERSHIP (USER_ID_, GROUP_ID_) values ( ?, ? )\n### Cause: java.lang.NullPointerException’. Flush summary: \n [\n INSERT MembershipEntity[4d709e6d-7a50-11ea-931e-005056b04c95]\n]”
}

Hi @oronzo_lezzi,

the group has to exist in the database. After you create it (https://docs.camunda.org/manual/7.12/reference/rest/group/post-create/), you can add members to it.

Hope this helps, Ingo

Thanks, was a my mistake in the REST API.
So I must to write code to insert all the users and put then in a group. I cannot use only one API call to create all the users as you write in the first response.
Is it correct ?
Thanks
O.

Hi @oronzo_lezzi,

yes, your assumption is correct.

My first understanding was, that all users belong to the same (existing) group.

Cheers, Ingo

1 Like