I am using Services module to register new users. My registration form has some custom fields like text field, radio buttons and select list. The following is the data I am sending:
{
"name" : "testapi",
"mail" : "test@test.com",
"pass" : "testapi",
"field_name" : {
"und" : [ { "value" : "Prashant TestAPI" } ]
},
"field_contact_no" : {
"und" : [{ "value" : "9898989898" }]
},
"field_user_sex " : {
"und" : [ { "value" : "male" } ]
},
"field_role_s_ " : {
"und" : [ {"value" : "developer"}, { "value" : "tester" } ]
}
}
The other fields like username, password, email and name(textfield) goes through fine but the sex is a radio button and role is a checkbox, those are not getting populated.
If there a specific way of handling those form types?
Update:
I was able to get it to work with the following code.
{
"name" : "apiuser",
"mail" : “apiuser@example.com",
"pass" : "testapi",
"field_name" : {
"und" : [ { "value" : "Prashant TestAPI" } ]
},
"field_contact_no" : {
"und" : [{ "value" : "9898989898" }]
},
"field_user_sex" : {
"und" : "male"
},
"field_role_s_" : {
"und" : ["developer","other"]
}
}