Introduction
If you want to store documents with large data, the Microsoft SharePoint connector is used for document management, and it enables integration with SharePoint through its REST API.
Sharepoint Connector in Mule4
MuleSoft provides the Sharepoint connector to allow the user to retrieve from and add the files to the SharePoint site.Â
It supports operations for List and List Items API, Files, and Folders API to create, delete, retrieve, and update documents.
The following steps are used to add the SharePoint connector in the Mule palette
- From Anypoint Studio Go to -> Mule Palette -> Click Search in Exchange -> Sharepoint.
- Add the Sharepoint into Mule Palette.
- From Mule Palette, drag and drop Sharepoint connectors to your flow.
Authentication
MuleSoft provides different authentication schemes for Microsoft Sharepoint Connector.
- OAuth v2.0 Authorization Code
- Sharepoint Online
- Okta
- Security Token
Sharepoint Site
Get Sharepoint List Id from Your Sharepoint site
Before start performing any operations on Sharepoint using MuleSoft, we need to get the List Id from the Sharepoint site.
- Log into your SharePoint using your credential.
- To click the Edit current view, select the All Documents option
- The next page opens and now scroll down the page
- The Web address for this mobile view option is available to get ListId
https://metasofttechsolutions.sharepoint.com/sites/testsharepoint1/_layouts/15/mobile/viewa.aspx?List=98e77c5f%2D9ce8%2D487c%2Da1df%2Dd437d91067a1&View=895c1408%2D0a82%2D4ed0%2Db9f1%2Dd2acbf3ede38
SharePoint Connector Configuration
To create a new project in Anypoint studio, the following steps help to create it.
- Click the Create button and filter the Sharepoint Online Connector.
- Choose the connection type as Online.
- The Example of SharePoint credential:
Online username: samle@domain.com
Online Password: XXXXXXXX
Site url: https://mstxyz.sharepoint.com/sites/testsharepoint
- Ensure the connection is working by using Test connection button
Test Flow1
This is the sample flow to read a file from local and it is added in SharePoint using Sharepoint connector in Mule4
Output:
Test Flow – 2
This is the second sample flow to read the file from Sharepoint using the Sharepoint connector in Mule4
Output: