Graph API Create documentSetVersions in a List

Sheheryar Chagani 0 Reputation points
2024-04-23T12:32:29.35+00:00

Hi,

I am trying to create a documentSetVersions using the POST API ("sites/{site-id}/lists/{list-id}/items/{item-id}/documentSetVersions"). Below is the body in JSON format being send to API.

{
  "comment": "put your comments about the version here",
  "shouldCaptureMinorVersion": false,
  
}

Furthermore, I am setting up Content-Type as mentioned in the documentation. However, I am getting below error:

"code": "invalidRequest",
        "message": "One of the provided arguments is not acceptable.",
        "innerError": {
            "code": "badArgument",

Please note all required permissions have been granted.

Regards
Sherry

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

1 answer

Sort by: Most helpful
  1. RaytheonXie_MSFT 33,641 Reputation points Microsoft Vendor
    2024-04-24T01:48:59.98+00:00

    Hi @Sheheryar Chagani

    As the error message, you should check the arguments. In the json you provide, you have added an extra comma.

    User's image

    The right json should be like

    { 
        "comment": "put your comments about the version here", 
        "shouldCaptureMinorVersion": false 
    }
    
    
    

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

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.