How to Integrate SharePoint With MuleSoft
In this tutorial, learn how to integrate SharePoint with MuleSoft (Mule 4) and perform some basic operations.
Join the DZone community and get the full member experience.
Join For FreeThis tutorial will help you integrate SharePoint with MuleSoft (Mule 4) and perform some basic operations.
Microsoft SharePoint Connector supports both SharePoint 2013 and SharePoint Online for the use in the cloud and on-premises.
It is used to manage content and documents. We can perform multiple operations with SharePoint like file upload, folder creation, reading files, etc.
Integrating SharePoint With MuleSoft
Before get started, make sure to have access to SharePoint. If not, please create a free trial account and obtain the credentials.
Once you have access to SharePoint, follow the below steps to connect SharePoint with MuleSoft in Mule 4.
SharePoint Global Configuration:
Now, let’s perform a few basic operations such as “Create folder” and “Upload a sample file to folder.”
Follow the below steps to create the folder and upload a sample PNG file to the SharePoint folder.
Step 1: Drag and drop HTTP Listener and configure accordingly to trigger a request.
Step 2: Add SharePoint Folder create node and configure as shown below:
Here, the connector configuration and the URL (Folder location) is mandatory. For example, /Share Documents/Vanchiv
creates a new folder Vanchiv
under Shared Documents
Step 3: Now add File Read node and configure to read a sample PNG file as shown below:
Step 4: Now add SharePoint File add node to upload the retrieved file to folder.
Step 5: Finally, add a transform message to send a success response to users/clients.
%dw 2.0
output application/json
---
{
"message": "The file has been uploaded to SharePoint"
}
The flow would look like:
Now, run the application and fire a sample request, then verify the whether the folder and file present in SharePoint or not.
There, you can see a new folder Vanchiv and a PNG file SharePoint-config has been uploaded. You can perform other operation in a similar way.
Conclusion
We hope this article helped you to integrate SharePoint with MuleSoft in Mule 4 and also perform a few basic operations using SharePoint connector.
Published at DZone with permission of Nagaraju Kshathriya. See the original article here.
Opinions expressed by DZone contributors are their own.
Comments