Some properties are not allowed to be set: email

It strikes me that the documentation for the rest of the api does not include the email as user data? is this an error or is it missing?

if I add it I get the following error Some properties are not allowed to be set: email

What should I do to save the user’s email through the rest of the user’s api?

Can you share the REST url and data that you are sending to reproduce this?

$user_data=’{“username":“test”,“password”:“Admin123”,“email”:"test@gmail.com”,“person”:{“names”:[{“givenName”:“test”,“familyName”:“testFamily”}],“gender”:“F”},“roles”:[“d52ecefe-6153-493e-a064-74881bb900cf”]}’;

$user_curL = curl_init(‘http://localhost:8080/openmrs/ws/rest/v1/user’); curl_setopt($user_curL, CURLOPT_HTTPAUTH,CURLAUTH_BASIC); curl_setopt($user_curL, CURLOPT_USERPWD,“admin:Admin123”); curl_setopt($user_curL, CURLOPT_RETURNTRANSFER,true); curl_setopt($user_curL, CURLOPT_HTTPHEADER, array(‘Content-Type:application/json’)); curl_setopt($user_curL, CURLOPT_POST,1); curl_setopt($user_curL, CURLOPT_POSTFIELDS,$user_data);

$output = curl_exec($user_curL); $response = json_decode($output); $status = curl_getinfo($user_curL,CURLINFO_HTTP_CODE);

I need to save the email as the user’s field

Which versions of the OpenMRS platform and webservices rest module are you running?

The email field was added in platform 2.2.0 via this ticket. It is not yet added to the webservices rest module. Feel free to create a ticket for it under the webservices rest JIRA project.

I don’t have permission to view the ticket

You can request for access via helpdesk. https://openmrs.atlassian.net/servicedesk/customer/portals