Skip to main content
Skip table of contents

Operation: ListMailFolders

The ListMailFolders operation creates a list of existing email folders.

Note:

The Limit and Offset parameters can be used to specify how many items are output.

By default, 10 items are output.

If needed, you can use the Limit and Offset parameters in the adapter to get more than 10 elements in the output.

It should be noted that the MS Graph API can output a maximum of 1000 items at once. For example, if 2000 items are to be retrieved, an iteration with the appropriate paging settings is required. This means for the second iteration the value 2000 would have to be set for Limit and the value 1001 for Offset.

Input

The adapter expects the Access Token from the MS Graph Auth Adapter with associated mapping as input.

Output

The adapter generates a list of email folders present in the Outlook account with the corresponding email folder ID as output:

Example
XML
<?xml version="1.0" encoding="UTF-8"?>
<MailFolder>
   <Object>
      <Value name="id" type="String">AAMkAGI0NDU3YTMxLTVkOTktNGQ2Zi04OGViLTgzNWM1YWFlNjAwNwAuAAAAAABqZX6HQaolT792ILCaL-z8AQCRrcaFxKxcR7F2mRmZk4TVAAAAAAEXAAA=</Value>
      <Value name="displayName" type="String">Inbox</Value>
      <Value name="parentFolderId" type="String">AAMkAGI0NDU3YTMxLTVkOTktNGQ2Zi04OGViLTgzNWM1YWFlNjAwNwAuAAAAAABqZX6HQaolT792ILCaL-z8AQCRrcaFxKxcR7F2mRmZk4TVAAAAAAEIAAA=</Value>
      <Value name="childFolderCount" type="Number">0</Value>
      <Value name="unreadItemCount" type="Number">0</Value>
      <Value name="totalItemCount" type="Number">0</Value>
      <Value name="sizeInBytes" type="Number">0</Value>
      <Value name="isHidden" type="Boolean">false</Value>
   </Object>
<Object>
      <Value name="id" type="String">AAMkAGI0NDU3YTMxLTVkOTktNGQ2Zi04OGViLTgzNWM1YWFlNjAwNwAuAAAAAABqZX6HQaolT792ILCaL-z8AQCRrcaFxKxcR7F2mRmZk4TVAAAAAAEPAAA=</Value>
      <Value name="displayName" type="String">Drafts</Value>
      <Value name="parentFolderId" type="String">AAMkAGI0NDU3YTMxLTVkOTktNGQ2Zi04OGViLTgzNWM1YWFlNjAwNwAuAAAAAABqZX6HQaolT792ILCaL-z8AQCRrcaFxKxcR7F2mRmZk4TVAAAAAAEIAAA=</Value>
      <Value name="childFolderCount" type="Number">0</Value>
      <Value name="unreadItemCount" type="Number">7</Value>
      <Value name="totalItemCount" type="Number">16</Value>
      <Value name="sizeInBytes" type="Number">7453898</Value>
      <Value name="isHidden" type="Boolean">false</Value>
   </Object>
 <Object>
      <Value name="id" type="String">AAMkAGI0NDU3YTMxLTVkOTktNGQ2Zi04OGViLTgzNWM1YWFlNjAwNwAuAAAAAABqZX6HQaolT792ILCaL-z8AQCRrcaFxKxcR7F2mRmZk4TVAAAAAAEJAAA=</Value>
      <Value name="displayName" type="String">Sent</Value>
      <Value name="parentFolderId" type="String">AAMkAGI0NDU3YTMxLTVkOTktNGQ2Zi04OGViLTgzNWM1YWFlNjAwNwAuAAAAAABqZX6HQaolT792ILCaL-z8AQCRrcaFxKxcR7F2mRmZk4TVAAAAAAEIAAA=</Value>
      <Value name="childFolderCount" type="Number">0</Value>
      <Value name="unreadItemCount" type="Number">0</Value>
      <Value name="totalItemCount" type="Number">591</Value>
      <Value name="sizeInBytes" type="Number">182028852</Value>
      <Value name="isHidden" type="Boolean">false</Value>
   </Object>
...
</MailFolder>

Note

Included in the output is metadata provided by MS Graph. More information about this metadata can be found in the official MS Graph documentation: 
https://learn.microsoft.com/en-us/graph/

The following elements and attributes can be included in the output:

Element

Description

MailFolder

Enclosing element for the operation ListMails

Object

Enclosing element for the Value elements with details of the email folders:

  • ID of the email folder

  • Name of the email folder

  • ID of the parent email folder

  • Number of sub-folders

  • Number of unread items

  • Total number of items in the folder

  • Size of the email folder in bytes

  • Visibility of the folder

Value

The Value element can contain different values in the name attribute.

Possible values:

  • id: ID of the email folder

  • displayName: Name of the email folder

  • parentFolderId: ID of the parent email folder

  • childFolderCount: Number of sub-folders

  • unreadItemCount: Number of unread items

  • totalItemCount: Total number of items in the folder

  • sizeInBytes: Size of the email folder in bytes

  • isHidden: Visibility of the folder

The type attribute specifies the type of the given data:

  • String: Any string

  • Number: Any integer

  • Boolean: Boolean value with the options true or false

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.