Get Tenant Id from SharePoint App | JavaScript

In rare cases, you may need to find id for Office 365 tenant or SharePoint app catalog tenant id. This solution is for you, who want to get tenant id or unique id for a SharePoint farm with in a SharePoint App using JavaScript.

This solution can only be used when host web has SharePoint App installed, reason for that is, in order to get tenant id, it uses the product id of the app. If SharePoint App is installed in the site, this solution can be used in the host web or in the app web.

 

Searching with the Office 365 APIs – Richard diZerega

Today, Microsoft quietly launched the “search” permission scope in Azure AD Applications. This is huge step in delivering new scenarios with the Office 365 APIs that leverage SharePoint search and the Office Graph. In this post, I’ll illustrate how to leverage search with the Office 365 APIs and use it to query site collections and modern groups a user has access to (a difficult/impossible task with the Office 365 APIs until today).

via Searching with the Office 365 APIs – Richard diZerega’s Blog – Site Home – MSDN Blogs.