Hello community,
I am using Rest api to download the list of issues using this command
/rest/api/2/search?jql=ORDER%20BY%20Created&maxResults=50&startAt=0
This works fine, however, when providing wrong credentials or Api token, JIRA returns the following :
"{""startAt"":0,""maxResults"":50,""total"":0,""issues"":[]}"
It says that there are 0 issues, it does not give an error.
Is there another REST fonction which I can use to test my credentials and tell the user that the username or token is wrong ?
The above return is not reliable: does it return 0 issues because there are no issues or does it return 0 because the credentials are wrong ?
Thank you
Try this one - https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issues/#api-rest-api-3-issue-issueidorkey-get. It should return a 401 is unauthorized.
Thanks,
Kian
Thanks Kian. I tried this one, which seems to work for me:
/rest/auth/1/session
It returns the following if i introduce wrong credentials or an expired API token:
"{""errorMessages"":[""You are not authenticated. Authentication required to perform this operation.""],""errors"":{}}"
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.