Failed to get email user ==> error 403 forbidden

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',
        }).then(function (data) {
            return JSON.parse(data);
        }).catch(function (error) {  
          console.log('error email user => ' + JSON.stringify(error)) 
       });     }

i tried this url : wiki/rest/api/user/email?accountId={accountId}
and it return the same error



Firstly, I would recommend removing the authorization token from your post - especially if it is a real one.

Secondly to get the email the api: /wiki/rest/api/user/email is correct. However, you need to request specific permission for you app to use this API: Guidelines for requesting access to email address.

It is also still possible for a user to hide their email adress, even if your app has the ACCESS_EMAIL_ADDRESSES scope that is required.

Also note that normally, AP.request is adding the authorization header for you, no need to add that explicitly.