Skip to content

Refactor spo contenttype sync to use SharePoint REST API instead of Microsoft Graph #7425

Description

@milanholemans

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"
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions