1

I follow this answer How to create user with role(s) through REST service?

{"name":"user343","pass":"kes35@r4","mail":"user343@sample.com","status":"1", "roles":["4"]}

But When I check the created user, It role still is '2' (authenticated user)

0

Just install Auto Assign Role Module.

Then use this following json code:

{"name":"user3431","pass":"kes35@r4","mail":"user343@sample.com","status":"1", "user_roles":{"6"}}
0

Same issue occured with me. I used rules module to assign a role on user account creation based on certain field data.Hope it helps

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.