PnPJS support for Beta Endpoints

I'm trying to get some user properties from the Beta endpoint of Graph. I can currently get basic user Azure AD properties using the following:

//get graph user profile properties
async function getUserProps (){
await graph.me().then(function(user){
console.log(user);
});
}
getUserProps();

This works but returns only very basic user properties (using the V1.0 version of Graph) - I need to be able to pull the users Work Address from the Beta endpoint - I've tried using Graph.setEndpoint('beta') however this always results in returning the V1.0 profile details. Is there any way I can access the beta endpoint?

Alternatively, is there a way under the V1.0 endpoint to pull the Contact Details from Azure AD? They include the Work Address of the user.

Kind regards
Andy

Hello @abolam,

Please try out setEndpoint method to call the beta endpoint of Microsoft Graph:

graph.me.setEndpoint('beta').get()

Thanks, I thought it would be something like that just didn't know the syntax :smile: Works perfectly!

1 Like