My app is hosted here:
https://mySite.sharepoint.com/sites/path/myApp/
And user information is hosted here:
https://mySite.sharepoint.com/sites/path/_catalogs/users/simple.aspx
I already use this code to access lists outside of my app
function getLists() {
print("retrieving list");
var hostUrl = decodeURIComponent(getQueryStringParameter("SPHostUrl"));
currentcontext = new SP.ClientContext.get_current();
hostcontext = new SP.AppContextSite(currentcontext, hostUrl);
web = hostcontext.get_web(); // hostcontext instead of currentcontext
listCollection = web.get_lists();
list = listCollection.getByTitle(LIST_NAME);
listItemCollection = list.getItems(""); // use CAML query for specific requests
context.load(listItemCollection);
context.executeQueryAsync(sharePointReady, queryFailed);
}
How can I adjust this code to get a list of all the users in my website like their name and contact information? Or is there another method?
Thanks in advance.