Overview
A client-mode connector for a curated storage slice of Microsoft Graph OneDrive / SharePoint underhttps://graph.microsoft.com/v1.0:
Default
BASE_ADDRESS is https://graph.microsoft.com/v1.0 (no trailing slash). Topics use storage/sharepoint-and-onedrive/<object>/<verb>.
See the base guide: REST API Connectors.
Path encoding:
item_path is the path under the drive root without a leading slash (e.g. FolderA/telemetry.csv). URL-encode path segments in the publisher if they contain spaces or reserved characters. LoT ENDPOINT uses /drives/{value.json.drive_id}/root:/{value.json.item_path}:/content.Large upload sessions:
createUploadSession returns an uploadUrl that is not on graph.microsoft.com. When calling Putuploadchunk, set connector BASE_ADDRESS to that URL’s origin (scheme + host + port) and put path + query in upload_path. Do not send a Graph Authorization header — the session URL embeds auth. Same pattern as Teams Workflows webhooks and S3 presigned PUT.Prefer Hub secrets for Entra access tokens (
GET SECRET "GRAPH_ACCESS_TOKEN" or "SHAREPOINT_GRAPH_TOKEN"). Typical scopes: Files.ReadWrite.All, Sites.ReadWrite.All, and offline_access for refresh. This template has not been verified against a live Microsoft 365 tenant. Status remains blocked until an authenticated live smoke succeeds.Basic Syntax
Auth
- Graph events: pass Entra ID
access_tokenon each MQTT payload →Authorization: Bearer {value.json.access_token}. Prefer Hub secrets /GET SECRET "GRAPH_ACCESS_TOKEN"or"SHAREPOINT_GRAPH_TOKEN". Never commit real tokens. - Scopes:
Files.ReadWrite.All(drive content),Sites.ReadWrite.All(list items),offline_access(refresh). Application (client credentials) or delegated depending on your Entra app registration. - Upload chunk: no Authorization header. Split
uploadUrlinto origin →BASE_ADDRESSand path+query →upload_path. SendContent-Range/Content-Lengthas placeholders.
MQTT topics
Example payloads
List drive children (BASE_ADDRESS = https://graph.microsoft.com/v1.0):
{payload} forwards. Ensure content_type matches the body. Path/header placeholders come from value.json.*.
Create list item (device register):
Putuploadchunk with BASE_ADDRESS = uploadUrl origin:
Sources
- https://learn.microsoft.com/en-us/graph/api/driveitem-put-content
- https://learn.microsoft.com/en-us/graph/api/driveitem-createuploadsession
- https://learn.microsoft.com/en-us/graph/api/driveitem-list-children
- https://learn.microsoft.com/en-us/graph/api/listitem-create
- https://learn.microsoft.com/en-us/graph/api/driveitem-get
- https://learn.microsoft.com/en-us/graph/api/resources/onedrive
- https://learn.microsoft.com/en-us/graph/api/resources/sharepoint
- https://learn.microsoft.com/en-us/connectors/sharepointonline/

