When using the "rest/api/2/user/search" endpoint and passing the "username" parameter, I get the following message returned from the API.
{ "errorMessages": [ "The username query parameter was not provided" ], "errors": {}}
I'm currently using Postman, and attached is my GET request with my body content (as you can see, "username" is provided). I'm using basic authentication via an admin account, and I can manually search for users within the JIRA GUI, so I don't think there is a permissions issue.
I've also tried using the "rest/api/2/user" endpoint with both the "username" and "accountId" query parameters, but get a similar message.
{ "errorMessages": [ "Either the 'username' or the 'key' query parameters need to be provided" ], "errors": {}}
Any help you can provided would be appreciated.
Thank you.
Hi @Eric Adlard
When you are using GET method to search issues via jql you don't need use body.
Take a look at this example: https://developer.atlassian.com/server/jira/platform/jira-rest-api-examples/#searching-for-issues-examples
Regards,
Seba
Thanks for your reply - it pointed me in the right direction and I was able to resolve my issue by putting the parameters in the URL path of the GET request.
https://my.url/rest/api/2/user?username=abc123
I was then able to get back either a 200 for when the user existed, or a 404 when the user did not exist. Success!
Thanks again!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.