I try to push following json to server:

{"name": "k21","pass":"123","mail":"user@user.com","roles":{"6":"student"}}

It return me success.

{"uid":"35","uri":"http://drupal/daxuebao/api/user/35"}

But when I check the created user's role, It still authenticated user.

So, how to fix it?

Comments

kylebrowning’s picture

Category: Bug report » Support request
Status: Active » Closed (fixed)

the id is not a string, its an integer.

try { 6 : "student"}