Hello Readers,
Few days back, I was struggling to upload the file into Sharepoint folder using Business Central SAAS version, then I came up with the solution using REST API.
The solution is easily achievable using few lines of code and configuration.
Lets have a look how this works:
Pre-Requisite required:
1. Sharepoint site – with Admin Credentials
2. Business Central Access.
#A – Configuration of Sharepoint site
1. Sharepoint site with the read-write permission.
2. Register an app using the below commands and trust your share point site.
1. https://YourSharepointDomain.sharepoint.com/sites/BusinessCentral/_layouts/15/appregnew.aspx
Generate the Client Id and Client Secret, save all the information to be used in the later stage.
once all the required information is filled up, click on Create button.
2. Now, next step is to Trust the app with your sharepoint site (refer the below images).
Enter the below url:
https://YourSharepointDomain.sharepoint.com/sites/BusinessCentral/_layouts/15/appinv.aspx
into the app id – put the Client ID which you have generated in the last step.
Permission request xml:
<AppPermissionRequests AllowAppOnlyPolicy=”true”>
<AppPermissionRequest Scope=”http://sharepoint/content/sitecollection/web/list”
Right=”FullControl” />
</AppPermissionRequests>
Once the above setup is done, click on Create button and it will redirect to Trust windows, click on Trust It.
This completes the sharepoint configuration part, in the next blog we will see how to use the above into the business central and upload the file into the sharepoint.
Thank you,
Anish Agrawal
NAV/Business Central Developer
Connect me on : +91-9770757595
Linkedin :Anish Agrawal
Hello Anish, thank you for this great learning. I am struggling to authorise this in business central saas and I do need to put correct App Domain & Redirect URL. Could you please tell me what should I put in these two fields?