Summary
The spo contenttype sync command currently uses Microsoft Graph API to sync content types to a SharePoint site. This is inconsistent with most spo commands in this project, which primarily use SharePoint CSOM or REST APIs.
Because this command uses Graph, it requires Graph-specific SharePoint permissions. This creates an extra hurdle for users who otherwise already have the permissions needed for spo commands.
Problem
- Current implementation depends on Microsoft Graph API
- Requires additional Graph SharePoint permissions
- Inconsistent developer and user experience within the
spo command set
Proposed change
Refactor spo contenttype sync to use SharePoint REST API for syncing content types from the content type hub.
Suggested API request:
POST https://contoso.sharepoint.com/_api/v2.1/sites/<siteId>,<webId>/contentTypes/addCopyFromContentTypeHub
{
"contentTypeId": "0x0101009D1CB255DA76424F860D91F20E6C4118000FB0DD736EABAF4887D950ABD68BA9A3"
}
Summary
The
spo contenttype synccommand currently uses Microsoft Graph API to sync content types to a SharePoint site. This is inconsistent with mostspocommands in this project, which primarily use SharePoint CSOM or REST APIs.Because this command uses Graph, it requires Graph-specific SharePoint permissions. This creates an extra hurdle for users who otherwise already have the permissions needed for
spocommands.Problem
spocommand setProposed change
Refactor
spo contenttype syncto use SharePoint REST API for syncing content types from the content type hub.Suggested API request: