The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

PUT /rest/api/2/user?username={username} Returns 405 Method Not Allowed

Jerry Waldorf
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
October 2, 2017

PUT /rest/api/2/user?username=bob.smith@aquera.com Returns 405 Method Not Allowed

Content-Type: application/json

Accept: application/json

Authorization: Basic ....

{
"name": "bob.smith@aquera.com",
"emailAddress": "bob.smith@aquera.com",
"displayName": "Bob Smithhy"
}

 

Returns 405 Method No Allowed

1 answer

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Alex van Vucht (GLiNTECH)
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Champions.
October 2, 2017

I think you need to use POST, not PUT.

curl -d@/tmp/a -u <admin>:<password> -X POST -H "Content-Type: application/json" https://yoursite.atlassian.net/rest/api/2/user

Jerry Waldorf
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
October 4, 2017

POST is to create a new user, which works well.  We need to update an existing user which is why we are trying to get the PUT to work.

Alex van Vucht (GLiNTECH)
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Champions.
October 4, 2017

Yes, PUT works fine too.

[ec2-user@ip-10-111-111-111 ~]$ cat /tmp/a
{ "displayName" : "Admin User" }

[ec2-user@ip-10-111-111-111 ~]$ curl -d@/tmp/a -k -u <admin>:<password> -X PUT -H "Content-Type: application/json" https://yoursite.atlassian.net/jira/rest/api/2/user?username=admin

What version JIRA are you using? Have you tried escaping the @ symbol in the URL? 

PUT /rest/api/2/user?username=bob.smith%40aquera.com

TAGS
AUG Leaders

Atlassian Community Events