REST API call "email addresses in batch" returns 401 for multiple but not for single accountId

Hi! When I call the /wiki/rest/api/user/email/bulk?accountId=1 ( API docs ) then it returns JSON with acountId and email. It works ok with accountId=2 too. But when I merge them together /wiki/rest/api/user/email/bulk?accountId=1&accountId=2 then I got an error 401.

There was a similar topic for Jira cloud API and the recommended way to request multiple emails was: accountId=1&accountId=2

Thanks in advance,

Hi @gatis.tomsons,

Given that querying the accounts separately are successful, it seems like a bug if querying multiple accounts returns an 401 response - I would have expected a 400 response if the problem related to the formation of the query. I’ll check with the team responsible.


1 Like

@gatis.tomsons I believe your JWT is failing because the qsh field is considered invalid. Could you please have a look at how you are generating that value and whether it is handling the additional accountId values on the query string.

1 Like

Hi, thanks for the hint. We discovered that the values for the repeated parameter accountId in Canonical query string should be ordered alphabetically. In the documentation there are no examples where values are in unsorted state and then get sorted. It would be helpful to add some unsorted example with a note.

Thanks, @dmorrow and @cmacneill for fast response, I really appreciate that.

1 Like