The process of building custom applications and tools that interact with Microsoft SharePoint, including SharePoint Online in Microsoft 365.
Thank you for posting your question in the Microsoft Q&A forum.
Based on the latest documentation for the driveItem: preview endpoint, the behavior you have observed is actually expected and aligns with the Caution section of the API.
The documentation explains that preview URLs are rendered on behalf of the calling identity and are not intended to be shared with other users. When using application (app‑only) permissions, the preview is generated under the app’s identity, not under an end user’s identity. Therefore, when an end user attempts to open this URL directly, they may not have the same permissions or authentication context as the application, which results in the error message you are seeing.
Because of this design, there are only two supported approaches if you want reliable preview behavior for end users:
- Use
/createLinkto generate a shareable viewing link (subject to your organization’s sharing policies), or - Use delegated (per‑user) access tokens, allowing the preview URL to be opened by the same user identity that generated it.
You won’t be able to use a preview URL generated with application permissions as a general-purpose link to share with other users.
I hope this clarification is helpful. Let me know if you need further assistance.
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.