Skip to main content

Notifications

Customer experience | Sales, Customer Insights,...
Answered

Using REST api to upload image to Sharepoint folder using Ribbon

Posted on by 10

Hi,

I am current making a customize button next to the Sharepoint's default upload button to upload specific image.

Does anyone know the REST api structure to upload image from javascript/c# to sharepoint document?

Thanks in advance!

  • Verified answer
    cloflyMao Profile Picture
    cloflyMao 25,198 on at
    RE: Using REST api to upload image to Sharepoint folder using Ribbon

    Hi phamtri96,

    We need to get SharePoint OAuth access token to send request from our web resource to REST API endpoint of SharePoint.

    https://www.engineeredcode.com/blog/getting-a-sharepoint-oauth-access-token-in-a-dynamics-365-web-resource

    In addition, if you just want to upload image to SharePoint, an alternative is to create a webhook in Power Automate:

    Image data can be read using HTML 5 file reader API, then sending the data to the automatically generated endpoint.

    In the flow, the data will be saved to SharePoint site with OOB SharePoint connector.

    https://community.dynamics.com/crm/b/magnetismsolutionscrmblog/posts/how-to-trigger-a-microsoft-flow-from-a-custom-button-in-dynamics-365

    Regards,

    Clofly

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,240 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,149 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans