Graph API convert to other formats Error

Laura Serrano López 1 Reputation point

Using graph API, I have a .docx file stored on OneDrive, and I'm trying to convert the content to pdf following this page:
-> HTTP request -> GET /drive/items/{item-id}/content?format={format}

I obtain the document Assay.docx with the following item-id '01FA4YLQZRHSFJNXCIMBCLADQ6PMLTMWCJ'


I am using 'GET /drive/items/01FA4YLQZRHSFJNXCIMBCLADQ6PMLTMWCJ/content?format=pdf'
But does not work. Responds with error 'itemNotFound'.
What is wrong with my request?


I have also try with 'GET /me/drive/items/01FA4YLQZRHSFJNXCIMBCLADQ6PMLTMWCJ/content?format=pdf' :

Microsoft Graph Files API
Microsoft Graph Files API
A Microsoft API to create an app that connects with files across OneDrive, OneDrive for Business, and SharePoint document libraries.
305 questions
Microsoft Graph SDK
Microsoft Graph SDK
A Microsoft software developer kit designed to simplify building high-quality, efficient, and resilient applications that access Microsoft Graph.
738 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Carl Zhao_MSFT 18,296 Reputation points Microsoft Employee

    Hi @Laura Serrano López

    According to my test, this should be a problem with the Graph Explorer tool. You can switch to postman or other API tools to call the api.

    You need to grant the Files.ReadWrite.All application permission to your application in Azure AD, then use the client credential flow to get the token, and use the token to call{drive id}/items/{item id}/content?format=pdf endpoint. Then you will get the download URL, you just need to run it.


    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.