Sharepoint File Upload

Mendix Community, I am considering building an integration with Microsoft Sharepoint to upload files from a Mendix App into a Sharepoint drive.  I have the Graph integration working for authentication.  Has anyone else done this?  Any pitfalls to watch out for or pointers? Thanks! Mike
1 answers

Hi Mike,

As Rom said I recently created this integration at a client, where I had create, patch and extend folders and up-, download and delete files. The documentation is all there, it can get confusing though on which IDs to use. Some calls only require a SiteID and DriveID, wheres some (patches I used for instance) need a root(path), ListID or ListItemID. These are not always provided after a POST call, so you need separate GET calls on your newly created object to gather all necessary ID’s.

This depends on your specific needs though: my required PATCH to alter the main folder’s ContentType needed this approach for instance.

Most calls are pretty straightforward when you have the IDs, my advice for uploading files however would be to use the ResumableUpload functionality: otherwise you are restricted by a 4mb (iirc) upload limit. In this approach you need to first create an Upload Session, after which is is still possible to send the entire file in 1 go: . You can use the getFileSize java action from CommmunityCommons to set the ContentRange.

I ended up not using Graph Connector module at all, authentication was (in the end) done by calling a token call with the company’s TenantID.

Let me know if you need any other specific pointers :)

Good luck!