Project

General

Profile

Actions

Defect #32121

closed

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

Added by Emmanuel PRIZZI over 4 years ago. Updated over 4 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
REST API
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Invalid
Affected version:

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>


Files

1.png (87.7 KB) 1.png Emmanuel PRIZZI, 2019-09-23 18:46
2.png (85 KB) 2.png Emmanuel PRIZZI, 2019-09-23 18:46
3.png (39.4 KB) 3.png Emmanuel PRIZZI, 2019-09-23 18:46
4.png (35.5 KB) 4.png Emmanuel PRIZZI, 2019-09-23 18:49
5.png (87.1 KB) 5.png Emmanuel PRIZZI, 2019-09-23 18:49
Actions #1

Updated by Emmanuel PRIZZI over 4 years ago

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

Actions #2

Updated by Go MAEDA over 4 years 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.

Actions #3

Updated by Emmanuel PRIZZI over 4 years 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

Actions #4

Updated by Emmanuel PRIZZI over 4 years ago

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

Actions #5

Updated by Go MAEDA over 4 years ago

  • Resolution changed from Fixed to Invalid
Actions

Also available in: Atom PDF