Defect #32121

Create a new user via REST api Users by adding Projects and roles in the same way

Added by Emmanuel PRIZZI 12 months ago. Updated 12 months ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:REST API
Target version:-
Resolution:Invalid Affected version:3.4.6

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></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>

1.png (87.7 KB) Emmanuel PRIZZI, 2019-09-23 18:46

2.png (85 KB) Emmanuel PRIZZI, 2019-09-23 18:46

3.png (39.4 KB) Emmanuel PRIZZI, 2019-09-23 18:46

4.png (35.5 KB) Emmanuel PRIZZI, 2019-09-23 18:49

5.png (87.1 KB) Emmanuel PRIZZI, 2019-09-23 18:49

History

#1 Updated by Emmanuel PRIZZI 12 months ago

Thanks to Serge PACCALIN for his help on the POSTMAN software and for the php script ! :-)

#2 Updated by Go MAEDA 12 months ago

  • Status changed from New to Closed
  • Resolution set to Fixed

Please use forums for "how to" questions. Issues are used to report a bug, suggesting a new feature, or submitting a patch. Reading How to request help may be helpful for you.

#3 Updated by Emmanuel PRIZZI 12 months ago

Go MAEDA wrote:

Please use forums for "how to" questions. Issues are used to report a bug, suggesting a new feature, or submitting a patch. Reading How to request help may be helpful for you.

Ok I move it to How to (Help) topic

#4 Updated by Emmanuel PRIZZI 12 months ago

tikcet move to :https://www.redmine.org/boards/2/topics/58073

#5 Updated by Go MAEDA 12 months ago

  • Resolution changed from Fixed to Invalid

Also available in: Atom PDF