How can I get the email adress from the users by using the REST API? I'm authenticating with nonce, and it seems to be working since I can do POST requests and change stuff. Do I have to add something to make it return all the user info?
This is my JS:
(function($) {
var nonce = WPsettings.nonce;
var rest_url = WPsettings.rest_url;
$.ajax( {
url: rest_url + 'users/',
dataType: "json",
beforeSend: function ( xhr ) {
xhr.setRequestHeader( 'X-WP-Nonce', nonce );
}
} )
.done( function ( response ) {
console.log( response );
} );
})(jQuery);