Hi folks,
I was using “/rest/api/3/myself” this api to get the emailAddress. But in response we are not able to get it.Previously i was able to get the emailAddress. Some changes happened in api response.
This is the JavaScript code for getting the myself response
AP.require("request", function (request) {
request({
url: "/rest/api/3/myself",
success: function (response) {
// convert the string response to JSON
response = JSON.parse(response);
//function(xxxxxxxxx);
// dump out the response to the console
console.log(response);
},
error: function () {
console.log(arguments);
}
});
});
Thanks for your answer. Actually i want to know how we can get the email Id of current logged in user. So that’s why i am calling the myself api. Is there any way to get the email Id.
Why we need a email id since we want to generate the basic authorization token which is the combination of email id and apiToken in the form of base64.
Afaik, retrieval of the email address depends on the privacy setting of the user. So even if you requested access to the Email API, if the user wishes to set their email address to private, there’s really nothing you can do
Sample scenario:
I cannot see email address (in APIs, User Pickers, etc) anymore
When profile visibility is enabled, email is private by default. This means that other users cannot see a users email address and it will be replaced with a placeholder value.
To resolve this, the email needs to be set to something other than private for each user in the new profile visibility settings screen (not the old one with the radio buttons):
With this, it doesn’t matter if you’re calling the API as an app or as an integration, if the users have set their email to private then there’s nothing the Email API can do to get that.