Hi . i wanna get email adresse for a specific user by accountId and i have a 403 error
getEmailUser(accountId) {
let url = this.config.apiPath + "/user/bulk?accountId=" + accountId;
return AP.request({
url : "/rest/api/user/bulk?accountId="+accountId,
contentType: "application/json",
type: 'GET',
Authorization: "bWJvdWF6emEuc3BlY3RydW1ncm91cGVAZ21haWwuY29tOnd6UGhpRXBWd1JTN0E0aDhrRVRyODhGRg==",
}).then(function (data) {
console.log(data)
return JSON.parse(data);
}).catch(function (error) {
console.log('error email user => ' + JSON.stringify(error))
}); }
i tied this url : wiki/rest/api/user/email?accountId={accountId}
and it return the same error
hello i get the same problem
Hello @Mehdi
A 403 error tells you that the request is incorrectly formed, not that the permissions used for the request are incorrect. If the authentication credentials are incorrect or missing from the request, a 401 error is returned.
Your code has a mistake in it. If you look at where you define the URL for the request, you haven't provided the version number of which API to use, like this:
url : "/rest/api/3/user/bulk?accountId="+accountId,
However, even if you correct the mistake in your code, the API endpoint you've chosen will not tell you the user's email address, only other general information about them, because email addresses are privileged information.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Sunny Ape thank u for ur reply
I followed this documentation The Confluence Cloud REST API (atlassian.com) and it was not mentionned this url
url : "/rest/api/3/user/bulk?accountId="+accountId,
when i tried this url , its poster to me the same error
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Mehdi
OK, sorry, I thought you were trying to make a request to the Jira REST API, not the Confluence REST API. For Confluence you don't need to supply the API version in the request URL.
However, the underlying cause of a 403 error is still that you are making an invalid request, so there is either a mistake in your code or the structure of the request.
Even if you do fix the mistake in your code and send a properly formed request to that REST API endpoint and use the appropriate permissions, it will just return a 400 Bad Request response with the message:
com.atlassian.confluence.api.service.exceptions.BadRequestException:
This API is only available to approved Connect apps
...because the documentation for that endpoint specifically says it "Returns user email addresses for a set of accountIds. This API is only available to apps approved by Atlassian, according to these guidelines." and your code does not meet the criteria described in those guidelines.
If you use a REST API test tool like Postman, as I've recommended you do in other posts elsewhere, you would have discovered that all this is true:
I think you should spend some more time reading the documentation on how to use the REST API, what the different response codes indicate, and testing your code to see if you are sending a valid and correctly authenticated request place in the first instance.
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.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.