Create a DocumentSet via GraphAPI - doesn't define DOCUMENT-ID

Chris OConnor 0 Reputation points
2024-09-03T06:01:05.76+00:00

I'm using some GRAPH API commands to create a new DOCUMENT-SET.

This can't be done via 'normal' commands - but instead ;

  • Create a FOLDER (POST)

https://graph.microsoft.com/v1.0/sites/{{SITE_ID}}/drives/{{DRIVE_ID}}/root/children

  • Get the created DRIVEITEM - and SHAREPOINT ID
  • Change the Content Type (PATCH)

https://graph.microsoft.com/v1.0/sites/{{SITE_ID}}/lists/{{SHAREPOINT_LIST_ID}}/items/{{SHAREPOINT_LIST_ITEM_ID}}

-- DOCUMENT SET CREATED, BUT...

This works - to create a DocumentSet.

BUT - the DocumentSet does NOT get defined a 'DocumentId'. ❓❓

-- WORKS IN UI / POWERSHELL

When doing through the UI - it works.

Or - creating via PowerShell - it works. [Add-PnPDocumentSet]

The new DocumentSet IMMEDIATELY gets a DocumentId assigned.

-- GENERATED IN UI

The new DocumentSet will get a DocumentId, if I manually change a metadata value within the UI.

Long story short ;

  • CANNOT get a DocumentSet to be created - without the FOLDER/CT-SWITCH
    • This is a bug / missing feature already
  • CANNOT get a new DocumentSet to have a DocumentId

-- TESTING / SUPPORT PLEASE ??

I can provide a set of URL's I'm testing via POSTMAN - it. doesn't. work.

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
13,304 questions
SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
11,230 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Hitesh Pachipulusu - MSFT 3,545 Reputation points Microsoft External Staff
    2024-09-03T09:28:39.9666667+00:00

    Hello Chris OConnor,

    Thank you for contacting Microsoft Support.

    It appears you are experiencing a known issue with the Graph API when creating DocumentSets. The procedure you've undertaken serves as a workaround; however, the missing of the DocumentId is certainly an issue.

    Currently Microsoft Graph API for SharePoint doesn't have support for Document sets.

    You can start with requesting for feature in graph feedback portal, based on the number of people requesting for this feature and votes Microsoft Engineering team will consider for implementation.

    Hope this helps.

    If the answer is helpful, please click Accept Answer and kindly upvote it. If you have any further questions about this answer, please click Comment.


  2. Yakun Huang-MSFT 10,555 Reputation points Microsoft External Staff
    2024-09-03T09:51:27.2933333+00:00

    Hi @Chris OConnor

    Based on the resource type for documentSet in the Graph, there is no attribute for DocumentId included, so this is expected, so it is recommended that you use the PowerShell scheme.

    Hope this helps.

    If the reply is helpful, please click Accept Answer and kindly upvote it. If you have additional questions about this answer, please click Comment.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.