Defect #32121
closedCreate a new user via REST api Users by adding Projects and roles in the same way
0%
Description
Hello,
I want to create a new user in redmine via REST API Users and add him into a project and role.
How to do that with the REST API Users ? http://www.redmine.org/projects/redmine/wiki/Rest_Users
DO i have to use memberships REST API ? => http://www.redmine.org/projects/redmine/wiki/Rest_Memberships
How to do that please ?
detail:
Find Attached the screen shot of My POST request with POSTMAN.
I have genenerated a php page with cURL and the creation is working fine but I can't add the project and roles (see attachments 5.png)
I use the API key for the the authentification (without login and passowrd visible)
The GET request (GET /users.xml) with POSTMAN, return this information (containing Projects and roles)
http://witsbue1000dit.eur.gad.schneider-electric.com:3000/redmine/users/2369.xml?include=memberships,groups
<user>
<id>2369</id>
<login>SESA481984</login>
<firstname>Emmanuel</firstname>
<lastname>PRIZZI</lastname>
<mail>emmanuel.prizzi@non.se.com</mail>
<created_on>2019-09-20T19:54:28+02:00</created_on>
<last_login_on>2019-09-23T15:46:55+02:00</last_login_on>
<api_key>xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx</api_key>
<status>1</status>
<groups type="array"></groups>
<memberships type="array">
<membership>
<id>6722</id>
<project id="12" name="OnSite Connect"/>
<roles type="array">
<role id="7" name="issues-user"/>
<role id="3" name="Manager "/>
</roles>
</membership>
</memberships>
</user>
Files