none
Custom options on SharePoint Drive Items using Microsoft graph API? RRS feed

  • Question

  • Hi,

    I've been reading the documentation for the Microsoft Graph API, and I can't seem to find out how to set custom permissions for 3 use cases for any Drive Item File.

    I want to be able to:

    1. Create sharing links that have an expiry date
    2. Be able to embed the documents into a web viewer (the API says this is only available for One Drive personal)
    3. Be able to disable download and print of the document

    Here is what I'm able to do:

    1. Create a sharing link without expiry date
    2. I can get publicly viewable links for these documents, but embedding is disabled
    3. I can't figure out how to disable download and print for these documents.

    I'm storing my documents in a SharePoint Site under a Documents drive.

    Thank you.

    Friday, November 1, 2019 1:50 PM

Answers

  • I was able to figure out the answer to this question in case someone is looking in the future.

    Items in a SharePoint Drive have a "get preview" method which returns a temporary (embeddable) URL for web viewing. This disabled everything except viewing a document. Check for "Drive Item Preview" on the "Microsoft Graph Graph API".

    Friday, November 1, 2019 2:58 PM

All replies

  • I was able to figure out the answer to this question in case someone is looking in the future.

    Items in a SharePoint Drive have a "get preview" method which returns a temporary (embeddable) URL for web viewing. This disabled everything except viewing a document. Check for "Drive Item Preview" on the "Microsoft Graph Graph API".

    Friday, November 1, 2019 2:58 PM
  • Hi BigKitten0098,

    Thanks for your sharing this information. that's really helpful and gained me a lot. I suggest you mark it as ANSWER so that others who stuck with the same question will get answered quickly. 

    Best Regards,

    Baker Kong

    Monday, November 4, 2019 2:36 AM
  • Hi,

    I've marked it as the proposed answer.

    Monday, November 4, 2019 1:56 PM