Microsoft SharePoint Component
Interact with sites, drives, and items connected to your instance of Microsoft SharePoint.
Component key: ms-sharepointDescription
Microsoft SharePoint is a web-based collaborative platform that integrates with Microsoft Office. This component allows you to interact with your sites, drives, and items by making queries through the Microsoft Graph API.
Example SharePoint Integration
The examples repo has an example integration that you can import that demonstrates how to listen for changes to a SharePoint drive, or fetch lists and items from a SharePoint site.
This example integration contains five flows:
- Import SharePoint File on Event - Whenever a file is created/updated/deleted in your customer's selected Sharepoint drive, that file is fetched and uploaded to an "Acme" endpoint that your customer enters.
- Subscribe to SharePoint File Events - This flow runs every week and creates a subscription to a Sharepoint drive, instructing Sharepoint to send notifications to the Import SharePoint File on Event flow whenever files are updated.
- Run Subscription Flow on Deploy - This flow calls the Subscribe to SharePoint File Events once on instance deploy to ensure the subscription is configured immediately.
- Get Files from SharePoint - This is a synchronous flow that can be called from an external system to list files in a SharePoint drive.
- Fetch Events and Documents from Site Lists - This flow demonstrates how to fetch "lists" in a SharePoint site,. A "list" can represent a calendar of events or a directory with files in it.
Connections
Microsoft SharePoint OAuth 2.0
Once you have an instance of Microsoft SharePoint licensed to your account, you will need to create and configure a new "App Registration" within your Azure Active Directory tenant. When creating the application you will be prompted to select the 'Supported account types'. Under this section, be sure to select 'Accounts in any organizational directory (Any Azure AD directory - Multitenant)'.
You will need to go to "Platforms" and add the "Web" platform. In that section you should add Prismatic's OAuth 2.0 callback URL - https://oauth2.prismatic.io/callback
- as a Redirect URI.
Next, go to "Certificates & Secrets" for the app and add a new Client Secret. Note this value as you will need to supply it to the connection within Prismatic.
You will also need the Application (client) ID from the "Overview" page.
The last step of configuring the "App Registration" is assigning "App Permissions". Click "Add Permission", click on the square labeled "SharePoint", and then "Delegated permissions". You should select all permissions that are required for your desired integration.
Now, configure the OAuth 2.0 connection in Prismatic. Add an MS SharePoint OAuth 2.0 connection config variable:
- Use the Application (client) ID value for the Client ID field.
- Use the Client Secret for the same named field.
- If you didn't select Multitenant when creating the Azure application, you will need to replace the Authorize URL and Token URL with ones specific to your tenant.
Save your integration and you should be able to authenticate a user through MS SharePoint with OAuth 2.0.
Triggers
Webhook
Receive and validate webhook requests from Sharepoint for webhooks you configure. | key: webhook
Data Sources
List Drives from Source
A picklist of files in a given directory | key: listDrives | type: picklist
List Folders from Source
A picklist of folders in a given directory | key: listFolders | type: picklist
List Sites from Sharepoint
A picklist of Sites | key: listSites | type: picklist
Actions
Create a Subscription
Create a Subscription to notify you of changes to a resource | key: createSubscription
{
"data": {
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#subscriptions/$entity",
"id": "38031b7d-16b1-448a-8e68-68b8aec62315",
"resource": "/me/drive/root",
"applicationId": "0fed8223-8c47-4c71-ba78-92c6f9448725",
"changeType": "updated",
"clientState": "client-specific string",
"notificationUrl": "https://hooks.prismatic.io/trigger/SW5z",
"notificationQueryOptions": null,
"lifecycleNotificationUrl": null,
"expirationDateTime": "2023-07-01T11:23:00Z",
"creatorId": "6219df3c-04d4-4b39-b2a4-ad162a5dcb8f",
"includeResourceData": null,
"latestSupportedTlsVersion": "v1_2",
"encryptionCertificate": null,
"encryptionCertificateId": null,
"notificationUrlAppId": null
}
}
Create Item in Site List
Create a new item inside the given site list | key: createItemInSite
Create Site List Subscription
Create a Site List subscription for Microsoft SharePoint | key: createSiteListSubscription
{
"data": {
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#subscriptions/$entity",
"id": "e9d5b726-4478-4412-bfba-268530484566",
"resource": "sites/example.sharepoint.com,17cd4ada-1a76-420e-a7ec-4adaa3327c86,87742bc7-2d2f-404c-8255-d3d9fa9a6561/lists/3a3c0f6a-86da-4567-94d4-3b939da63200",
"applicationId": "e76615c0-13e3-4cd2-8235-a2d628ad13de",
"changeType": "updated",
"clientState": null,
"notificationUrl": "https://example.com/webhook/",
"notificationQueryOptions": null,
"lifecycleNotificationUrl": null,
"expirationDateTime": "2022-11-22T23:32:10.231Z",
"creatorId": "c8edbeda-c453-446c-91ce-c6d5c7310a6c",
"includeResourceData": null,
"latestSupportedTlsVersion": "v1_2",
"encryptionCertificate": null,
"encryptionCertificateId": null,
"notificationUrlAppId": null
}
}
Delete a Subscription
Delete a Subscription by ID | key: deleteSubscription
{
"data": ""
}
Delete All Instance Subscriptions
Delete all subscriptions pointed at this instance | key: deleteAllInstanceSubscriptions
{
"data": {
"subscriptionsRemoved": [
"26ebd1e9-c54a-4bbe-9583-fc05974952a4",
"b9b27172-ee2e-4248-86df-fc98cb71d914"
]
}
}
Download File
Download a file from the specified drive | key: downloadFile
Get Current User
Get the information and metadata of the user that is currently logged in | key: getCurrentUser
{
"data": {
"businessPhones": [
"+1 555 555 5555"
],
"displayName": "exampleUser",
"givenName": "exampleUser",
"jobTitle": "Retail Manager",
"mail": "someoneV@example.onmicrosoft.com",
"mobilePhone": "+1 555 555 5555",
"officeLocation": "example",
"preferredLanguage": "en-US",
"surname": "Example",
"id": "3693-4789-a1c3-f4de565f"
}
}
Get Drive
Returns the information and metadata of a SharePoint drive | key: getDrive
Get File
Get a file from a Drive | key: getFile
Get Item from Site List
Returns the information and metadata of the given item | key: getItemInSite
Get Root Site
Returns the information and metadata of the root SharePoint site in your tenant | key: getRootSite
{
"data": {
"description": "Example description",
"id": "example.sharepoint.com,c45e332-a998-479d-aeb2-2a",
"name": "Example SharePoint Site",
"webUrl": "https://example.sharepoint.com",
"displayName": "Communication Site",
"siteCollection": {
"hostname": "https://example.sharepoint.com"
}
}
}
Get Site
Returns the information and metadata of the given SharePoint site | key: getSite
{
"data": {
"description": "Example description",
"id": "example.sharepoint.com,c45e332-a998-479d-aeb2-2a",
"name": "Example SharePoint Site",
"webUrl": "https://example.sharepoint.com",
"displayName": "Communication Site",
"siteCollection": {
"hostname": "https://example.sharepoint.com"
}
}
}
Get Site List
Returns the information and metadata of an existing site list | key: getList
List Changes
Track changes in a driveItem and its children over time. | key: listChanges
List Drives
List all drives within any given SharePoint site | key: listDrives
{
"data": {
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#drives",
"value": [
{
"createdDateTime": "2023-05-14T05:14:52Z",
"description": "",
"id": "b!o2UaIfdNxk-5091VjGz1sDVso2efo6RGrpVCkPpe547Qrf38sox_TYIFuj9QrJhv",
"lastModifiedDateTime": "2023-05-14T05:14:52Z",
"name": "Documents",
"webUrl": "https://example.sharepoint.com/Shared%20Documents",
"driveType": "documentLibrary",
"createdBy": {
"user": {
"displayName": "System Account"
}
},
"owner": {
"group": {
"id": "9705118a-6ce1-4fa3-adba-09f94b69d568",
"displayName": "9705118a-6ce1-4fa3-acda-09f94b69d446"
}
},
"quota": {
"deleted": 0,
"remaining": 27487789251101,
"state": "normal",
"total": 27487790694400,
"used": 1443299
}
}
]
}
}
List Files in Drive
List all the files from a Drive | key: getFilesFromDrive
List Folder Files in Drive
List all the files inside of a folder from a Drive | key: getFilesFromDriveFolder
List Followed Sites
List all Followed Sites | key: listFollowedSites
{
"data": {
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#sites",
"value": [
{
"displayName": "Example",
"id": "example.sharepoint.com,6c44888f-5883-4ef0-c542-d21a802cfea6,ed2d5d06-e192-4047-afa6-a5d7f25b3418",
"sharepointIds": {
"siteId": "6c44888f-5883-4ef0-c542-d21a802cfea6",
"webId": "ed2d5d06-e192-4047-afa6-a5d7f25b3418"
},
"siteCollection": {
"hostname": "example.sharepoint.com"
},
"webUrl": "https://example.sharepoint.com/sites/Example"
}
]
}
}
List Items in Site List
Return all items inside the given site list | key: getListItemsInSite
List Shared Documents
Lists documents shared with the user. | key: listSharedDocuments
List Site Lists
List all Site Lists | key: listSiteLists
List Sites
List all SharePoint sites | key: listSites
{
"data": {
"value": [
{
"description": "Example description",
"id": "example.sharepoint.com,c45e332-a998-479d-aeb2-2a",
"name": "Example SharePoint Site",
"webUrl": "https://example.sharepoint.com",
"displayName": "Communication Site",
"siteCollection": {
"hostname": "https://example.sharepoint.com"
}
}
]
}
}
List Subscriptions
List all available Subscriptions | key: listSubscriptions
{
"data": {
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#subscriptions",
"value": [
{
"id": "38031b7d-16b1-448a-8e68-68b8aec6df45",
"resource": "/me/drive/root",
"applicationId": "0fed8223-8c47-4c71-ba78-92c6f9441235",
"changeType": "updated",
"clientState": null,
"notificationUrl": "https://hooks.prismatic.io/trigger/SW5",
"notificationQueryOptions": null,
"lifecycleNotificationUrl": null,
"expirationDateTime": "2023-07-01T11:23:00Z",
"creatorId": "62162f3c-04d4-4b39-b2a4-ad891a5dcb8f",
"includeResourceData": null,
"latestSupportedTlsVersion": "v1_2",
"encryptionCertificate": null,
"encryptionCertificateId": null,
"notificationUrlAppId": null
}
]
}
}
Raw Request
Send raw HTTP request to Microsoft Sharepoint | key: rawRequest
Update File
Update a file to the specified drive | key: updateFile
Update Site List Subscription Expiration
Update existing Site List subscription expiration for Microsoft SharePoint | key: updateSiteListSubscriptionExpiration
Subscriptions have an expiration date/time provided upon creation. This can also be modified with the update API. This action will default to adding 29 days (close to the maximum value for SharePoint resources) to the current date/time unless a value is specified. This is useful for "touching" the subscription to ensure its expiration is extended.
{
"data": {
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#subscriptions/$entity",
"id": "e9d5b726-4478-4412-bfba-268530484566",
"resource": "sites/example.sharepoint.com,17cd4ada-1a76-420e-a7ec-4adaa3327c86,87742bc7-2d2f-404c-8255-d3d9fa9a6561/lists/3a3c0f6a-86da-4567-94d4-3b939da63200",
"applicationId": "e76615c0-13e3-4cd2-8235-a2d628ad13de",
"changeType": "updated",
"clientState": null,
"notificationUrl": "https://example.com/webhook/",
"notificationQueryOptions": null,
"lifecycleNotificationUrl": null,
"expirationDateTime": "2022-11-22T23:32:10.231Z",
"creatorId": "c8edbeda-c453-446c-91ce-c6d5c7310a6c",
"includeResourceData": null,
"latestSupportedTlsVersion": "v1_2",
"encryptionCertificate": null,
"encryptionCertificateId": null,
"notificationUrlAppId": null
}
}
Upload File
Upload a file to the specified drive or folder's drive | key: uploadFile