
We have an integration between Microsoft Dynamics 365 Business Central (AL) and SharePoint Online for uploading and accessing files in document libraries.
Current permission (overly broad):
<AppPermissionRequests AllowAppOnlyPolicy="true"> <AppPermissionRequest Scope="http://sharepoint/content/sitecollection/tenant" Right="FullControl" /> </AppPermissionRequests>
We generate access tokens using:
POST https://accounts.accesscontrol.windows.net/{tenant-id}/tokens/OAuth/2
We are using SharePoint REST API:
Upload file:
POST https://<org>.sharepoint.com/sites/<site>/_api/web/GetFolderByServerRelativeUrl('/sites/<site>/Shared Documents')/Files/add(url='file.pdf',overwrite=true)
Download / read files:
GET https://<org>.sharepoint.com/sites/<site>/_api/web/GetFileByServerRelativeUrl('/sites/<site>/Shared Documents')/Files...
Any guidance, best practices, or migration examples would be highly appreciated.
If possible pls share some Blogs or resource when this overall new process is explain so that i can can a hit and start the development.