Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics 365 | Integration, Dataverse...
Suggested answer

Upload Sharepoint Document using Dynamics 365 Web API

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

I have a custom entity and integrated it with Sharepoint. I will be creating these records using web API. How can I add documents to SharePoint via API?

  • Victor Onyebuchi Profile Picture
    Victor Onyebuchi 392 on at
    RE: Upload Sharepoint Document using Dynamics 365 Web API

    Hi Arif,

    I am actually in need of a solution like this.

    Do you mind sharing the web API calls made? I wanna see the conversion of docs in your code and all?

    Thanks

  • Suggested answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Upload Sharepoint Document using Dynamics 365 Web API

    SOLVED!

    Thank you for all your messages.

    I solved my own question. Let's explain how I did.

    I did a bit search on Dynamics API and found this entity:"sharepointdocumentlocations"

    https://docs.microsoft.com/en-us/dynamics365/customer-engagement/web-api/sharepointdocumentlocation?view=dynamics-ce-odata-9

    And I made a GET request and it returns an attribute which is called "relativeURL"

    I saw that its value is: "_relatedRecordGuid". It always starts with underscore.

    And also I found that all files uploaded from Dynamics UI to sharepoint is under that folder.(If Dynamics record is different, than new folder created with "_newRecordGuid" and files uploaded under this folder.)

    I thought that I can create a new folder under my entity folder in SharePoint using SharePoint API. And I did.

    For example if the records guid is like below;

    createdRecordGuid="123asd123qwexxcv123..."

    I created folder which is called "_createdRecordGuid" under "entityname folder"(In my situation, it was "rd_jobapplication")

    so created Folders path is like: ("rd_jobapplication/_" + createdRecordGuid.upper()) //Folder names are UPPERCASE

    And I uploaded the file under this path.

    It solved my problem. Now I can see uploaded files using API, under the related record.

    Thanks.

  • Anrini Profile Picture
    Anrini on at
    RE: Upload Sharepoint Document using Dynamics 365 Web API

    I hope these will be useful

    blog.crgroup.com/.../

    docs.microsoft.com/.../sharepointdocumentlocation

  • Suggested answer
    Wahaj Rashid Profile Picture
    Wahaj Rashid 11,321 on at

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

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Tip: Become a User Group leader!

Join the ranks of valued community UG leaders

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,516 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,321 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans