Cannot use Graph API to convert minor vertion file to different file type in SharePoint

Johnson Yau 1 Reputation point
2022-10-12T03:02:29.34+00:00

The file type conversion request call cannot get the minor version file in SharePoint (e.g. 0.1, 0.2, 1.1), but it can only get major version (1.0, 2.0)

The library setting already set anyone with read right can see the minor version files. any configuration is missing to enable it?

await GraphClient.Sites[siteId].Lists[libID].Drive.Items[ItemID].Content  
                            .Request(new List<QueryOption>  
                            {  
                            new QueryOption("format", "pdf")  
                            })  
                            .GetAsync();  
Microsoft 365 and Office SharePoint Development
Microsoft Security Microsoft Graph
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Tong Zhang_MSFT 9,251 Reputation points
    2022-10-12T08:42:04.367+00:00

    Hi @Johnson Yau ,

    Do you want to use the Graph API to get the minor versions of the file in SharePoint? if yes, please try to use the following Graph API to get the minor versions:

    https://graph.microsoft.com/v1.0/sites/{site-id}/lists/{list-id}/items/{item-id}/versions?$select=id,lastModifiedDateTime  
    

    Here is my test result:

    249568-01.png

    You can use the following Graph API to get the specified minor version of the file:

    https://graph.microsoft.com/v1.0/sites/{site-id}/lists/{list-id}/items/{item-id}/versions('0.4')  
    

    Hope it can help you. Thanks for your understanding.


    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.



  2. Srinivasa Rao Darna 6,761 Reputation points Microsoft External Staff
    2022-10-12T11:00:09.477+00:00

    Hi @Johnson Yau ,

    As per my test, convert drive file works fine with GET /drive/items/{item-id}/content?format={format}, see below my test results and in this test my library has minor and major versions enabled, and I tried to convert the file with 0.4 minor version.

    249677-image.png

    249647-image.png

    For better understanding can you share the library versioning settings screenshot and any error message in Graph response.

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


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.