Square 9 iPaaS – Microsoft Graph API Integration, Sharepoint
Microsoft Graph API is the preferred and modern approach for any Office 365 integration. Square 9’s iPaaS node supports Graph API natively using the OAuth 2.0 client credentials grant.
To begin, you must have a Tenant ID, Client ID, and Client Secret created through an App Registration in Microsoft Entra ID. These credentials must be secured (e.g., in Key Vault or environment variables). Do not attempt to set up iPaaS without them.
iPaaS Connection
Authentication URL
Code
CODEhttps://login.microsoftonline.com/{TenantID}/oauth2/v2.0/tokenReplace
{TenantID}with your Entra tenant GUID or domain (e.g.,contoso.onmicrosoft.com). This value can also be set dynamically in a workflow process field.Base URL
Code
CODEhttps://graph.microsoft.com/v1.0Use
v1.0for production. Thebetaendpoint exists for preview features but should not be used in production.Grant Type Select OAuth 2.0 – Client Credentials Grant. If this option is not available, update your node version in GlobalCapture Administration.
Auth Request Body Parameters must be sent as x-www-form-urlencoded key/value pairs:
Code
CODEgrant_type=client_credentials& client_id=YourClientID& client_secret=YourClientSecret& scope=https://graph.microsoft.com/.default
Graph API and SharePoint
The Request setting defines the API call. For example, to list sites available to the authenticated account, specify:
Code
sites
This will call https://graph.microsoft.com/v1.0/sites.
Graph returns results in a standard OData
valuearray. Standard iPaaS mapping rules apply, with a Format Expression of$.Avoid using display name references in requests. Graph does not reliably resolve them. Always use IDs or path‑based references.
Use tools such as Postman to test requests and retrieve necessary IDs before building workflows.
Adding a New File
Graph API uses a PUT request to upload document content to SharePoint. Important: Direct PUT uploads are limited to files ≤ 4 MB. Larger files require an upload session (createUploadSession).
Example Request:
Code
sites/{siteId}/drives/{driveId}/root:/foldername/{ORIGINALFILENAME}.pdf:/content
Where:
{siteId}→ ID of the site, retrieved from/sites.{driveId}→ ID of the drive (document library), retrieved from/drives.foldername→ target folder. Nested paths are supported. Non‑existent folders are created automatically.{ORIGINALFILENAME}→ file name to assign.
⚠️ Overwrites: This direct PUT method does not allow overwriting files with the same name. If the file already exists, the request will return an error.
Node Settings
Ensure the HTTP method is set to PUT in the Request Body section.
Select Send document (bytes) so the binary file content is streamed in the request body.