MS Teams – Channels – Get Channel Files Folder
MS Teams – Channels – Get Channel Files Folder
Get the SharePoint folder where channel files are stored.
Action details
| Property | Value |
|---|---|
| Action label | MS Teams – Channels – Get Channel Files Folder |
| Category | CloudTools |
| Apex class and method | GetMSTeamsChannelFilesFolder.getChannelFilesFolder |
| Input type | GetMSTeamsChannelFilesFolder.GetMSTeamsChannelFilesFolderInput |
| Output type | List<MSGraphDriveItem> |
| Authorization | Microsoft 365 connector; check endpoint support for delegated and application access. |
| Microsoft Graph request | GET /teams/{teamId}/channels/{channelId}/filesFolder |
Prerequisites and permissions
Configure a CloudTools Connector with Connector Type set to Microsoft 365. Complete Microsoft sign-in for OAuth Delegated (Authorization Code). For endpoints supporting OAuth Application (Client Credentials), grant application permissions and administrator consent. The identity must have access to the selected resource. See Creating an Entra ID App and Integration Connectors for setup.
The action permission provider declares these alternatives. They are not cumulative requirements, and not all are least privileged. Confirm endpoint restrictions and any resource-specific consent requirements in the Microsoft reference.
| Permission type | Declared alternatives |
|---|---|
| Delegated | Files.Read.All, Files.Read, Files.ReadWrite, Files.ReadWrite.All, Group.Read.All, Group.ReadWrite.All, Sites.Read.All, Sites.ReadWrite.All |
| Application | Files.Read.All, File.Read.Group, Files.ReadWrite.All, Group.Read.All, Group.ReadWrite.All, Sites.Read.All, Sites.ReadWrite.All |
Endpoints: /teams/{teamId}/channels/{channelId}/filesFolder. Resource-specific consent and installation requirements apply to resource-specific permissions. Group and Directory permissions are listed for backward compatibility.
See the Microsoft operation and permissions reference.
Inputs
| Input | Apex field | Type | Required | Description |
|---|---|---|---|---|
| Team Id | teamId | String | Yes | MS Teams team identifier |
| Channel Id | channelId | String | Yes | MS Teams channel identifier |
Supply a nonempty list with a non-null first request. This implementation processes only the first request and does not bulk-process Flow interviews. Global inputs do not expose connectorId; Flow and subscriber Apex use CloudTools connector selection. Use Microsoft Graph IDs, not Salesforce IDs or browser links. Resolve dynamic values before invoking this action.
Outputs
Returns one MSGraphDriveItem inside a list, or an empty list if no resource is mapped. Check for an empty result before reading fields.
| Output | Apex field | Type | Description |
|---|---|---|---|
| id | id | String | Mapped drive item property; populated only when returned and supported by the resource. |
| name | name | String | Mapped drive item property; populated only when returned and supported by the resource. |
| description | description | String | Mapped drive item property; populated only when returned and supported by the resource. |
| createdDateTime | createdDateTime | String | Mapped drive item property; populated only when returned and supported by the resource. |
| lastModifiedDateTime | lastModifiedDateTime | String | Mapped drive item property; populated only when returned and supported by the resource. |
| createdBy | createdBy | MSGraphDriveIdentitySet | Mapped drive item property; populated only when returned and supported by the resource. |
| lastModifiedBy | lastModifiedBy | MSGraphDriveIdentitySet | Mapped drive item property; populated only when returned and supported by the resource. |
| webUrl | webUrl | String | Mapped drive item property; populated only when returned and supported by the resource. |
| webDavUrl | webDavUrl | String | Mapped drive item property; populated only when returned and supported by the resource. |
| size | size | Long | Mapped drive item property; populated only when returned and supported by the resource. |
| eTag | eTag | String | Mapped drive item property; populated only when returned and supported by the resource. |
| cTag | cTag | String | Mapped drive item property; populated only when returned and supported by the resource. |
| odataType | odataType | String | Mapped drive item property; populated only when returned and supported by the resource. |
| odataEtag | odataEtag | String | Mapped drive item property; populated only when returned and supported by the resource. |
| downloadUrl | downloadUrl | String | Mapped drive item property; populated only when returned and supported by the resource. |
| sourceUrl | sourceUrl | String | Mapped drive item property; populated only when returned and supported by the resource. |
| conflictBehavior | conflictBehavior | String | Mapped drive item property; populated only when returned and supported by the resource. |
| content | content | String | Mapped drive item property; populated only when returned and supported by the resource. |
| parentReference | parentReference | MSGraphDriveItemReference | Mapped drive item property; populated only when returned and supported by the resource. |
| fileSystemInfo | fileSystemInfo | MSGraphDriveFileSystemInfo | Mapped drive item property; populated only when returned and supported by the resource. |
| folder | folder | MSGraphDriveFolderFacet | Mapped drive item property; populated only when returned and supported by the resource. |
| file | file | MSGraphDriveFileFacet | Mapped drive item property; populated only when returned and supported by the resource. |
| image | image | MSGraphDriveImageFacet | Mapped drive item property; populated only when returned and supported by the resource. |
| photo | photo | MSGraphDrivePhotoFacet | Mapped drive item property; populated only when returned and supported by the resource. |
| audio | audio | MSGraphDriveAudioFacet | Mapped drive item property; populated only when returned and supported by the resource. |
| video | video | MSGraphDriveVideoFacet | Mapped drive item property; populated only when returned and supported by the resource. |
| location | location | MSGraphDriveGeoCoordinates | Mapped drive item property; populated only when returned and supported by the resource. |
| deleted | deleted | MSGraphDriveDeletedFacet | Mapped drive item property; populated only when returned and supported by the resource. |
| pendingOperations | pendingOperations | MSGraphDrivePendingOperations | Mapped drive item property; populated only when returned and supported by the resource. |
| packageInfo | packageInfo | MSGraphDrivePackageFacet | Mapped drive item property; populated only when returned and supported by the resource. |
| publication | publication | MSGraphDrivePublicationFacet | Mapped drive item property; populated only when returned and supported by the resource. |
| remoteItem | remoteItem | MSGraphDriveRemoteItem | Mapped drive item property; populated only when returned and supported by the resource. |
| root | root | MSGraphDriveRootFacet | Mapped drive item property; populated only when returned and supported by the resource. |
| searchResult | searchResult | MSGraphDriveSearchResult | Mapped drive item property; populated only when returned and supported by the resource. |
| shared | shared | MSGraphDriveSharedFacet | Mapped drive item property; populated only when returned and supported by the resource. |
| sharepointIds | sharepointIds | MSGraphDriveSharePointIds | Mapped drive item property; populated only when returned and supported by the resource. |
| specialFolder | specialFolder | MSGraphDriveSpecialFolder | Mapped drive item property; populated only when returned and supported by the resource. |
| malware | malware | MSGraphDriveMalwareFacet | Mapped drive item property; populated only when returned and supported by the resource. |
| bundle | bundle | MSGraphDriveBundleFacet | Mapped drive item property; populated only when returned and supported by the resource. |
| children | children | List<MSGraphDriveItem> | Mapped drive item property; populated only when returned and supported by the resource. |
| permissions | permissions | List<MSGraphDrivePermission> | Mapped drive item property; populated only when returned and supported by the resource. |
| versions | versions | List<MSGraphDriveItemVersion> | Mapped drive item property; populated only when returned and supported by the resource. |
| thumbnails | thumbnails | List<MSGraphDriveThumbnailSet> | Mapped drive item property; populated only when returned and supported by the resource. |
| listItem | listItem | MSGraphDriveListItem | Mapped drive item property; populated only when returned and supported by the resource. |
| analytics | analytics | MSGraphDriveItemAnalytics | Mapped drive item property; populated only when returned and supported by the resource. |
Behavior and limits
Returns folder metadata only; it does not transfer file content. The shared drive model contains fields for other operations which this endpoint may leave empty.
Use in Flow
Add MS Teams – Channels – Get Channel Files Folder where supported. Use a Microsoft 365 application connector configured as Set as default for Flow automations only if the endpoint supports the required application operation. Delegated connections are not supported for CloudTools Flow automation. Supply required values, retain outputs, and add fault handling.
Use in custom Apex
This subscriber-org example uses the Apptigent namespace. Replace example identifiers and values before use. Configure the connector, arrange authorization first, run in a context permitting callouts, and handle exceptions and empty results.
Apptigent.GetMSTeamsChannelFilesFolder.GetMSTeamsChannelFilesFolderInput request =
new Apptigent.GetMSTeamsChannelFilesFolder.GetMSTeamsChannelFilesFolderInput();
request.teamId = '893075dd-2487-4122-925f-022c42e20265';
request.channelId = '19:private-channel@thread.tacv2';
List<Apptigent.MSGraphDriveItem> results =
Apptigent.GetMSTeamsChannelFilesFolder.getChannelFilesFolder(
new List<Apptigent.GetMSTeamsChannelFilesFolder.GetMSTeamsChannelFilesFolderInput>{ request }
);
System.debug(results);
Use in a Lightning Web Component
Use getMSTeamsChannelFilesFolder from msTeamsConnectorLib through MSTeamsConnectorController. Set request.connectorId to select a configured connector. These c/ imports apply in the same namespace. The controller uses a shared request DTO; its field names differ from the global invocable input.
| Global input | LWC request mapping |
|---|---|
teamId | request.teamId |
channelId | request.channelId |
teamsActionExample.js
import { LightningElement } from 'lwc';
import { getMSTeamsChannelFilesFolder } from 'c/msTeamsConnectorLib';
export default class TeamsActionExample extends LightningElement {
result = null;
errorMessage = '';
isRunning = false;
completed = false;
async handleRun() {
if (this.isRunning || this.completed) return;
this.isRunning = true;
this.errorMessage = '';
try {
const request = { connectorId: 'REPLACE_WITH_CONNECTOR_RECORD_ID' };
request.teamId = '893075dd-2487-4122-925f-022c42e20265';
request.channelId = '19:private-channel@thread.tacv2';
this.result = await getMSTeamsChannelFilesFolder(request);
this.completed = true;
} catch (error) {
this.errorMessage = error.requiresInteractiveAuthorization
? 'Sign in to Microsoft for the connector, then try again.'
: error.message || 'The Teams action failed.';
} finally {
this.isRunning = false;
}
}
}
teamsActionExample.html
<template>
<lightning-button label="Run action" onclick={handleRun}
disabled={isRunning}></lightning-button>
<p role="alert">{errorMessage}</p>
</template>
The library resolves to one mapped object or null. rawJson serializes the mapped Apex model rather than the untouched Microsoft response. Message body, membership roles, and nested properties can be flattened or serialized in JavaScript DTOs.
Use getMSTeamsAuthorizationState, beginMSTeamsAuthorization, and createMSTeamsOAuthMessageHandler to arrange delegated sign-in. The library normalizes errors but does not automatically sign in or retry. Reset completed for a new deliberate operation. Inspect resource state before retrying a mutation with an uncertain outcome.
Error handling and troubleshooting
| Symptom | What to check |
|---|---|
| Required fields error | Supply a nonempty request list, a non-null first request, and required or conditionally required values. For LWC, check controller mappings. |
| Authorization or access denied | Check selected connector, delegated versus application support, consent, Teams app installation where required, and access to the resource. |
| Resource not found | Check team, channel, chat, message, membership, and app installation IDs; these are distinct identifiers. |
| Missing data | Check pagination, query support, empty-response behavior, and documented model mapping. |
| Operation rejected | Inspect the Microsoft error, endpoint restrictions, supported properties, message authorization limits, and notification configuration. |