Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

216
Views
How to get office 365 outlook's folders name from a mailbox

I have authenticated for office 365 outlook using passport js

Now I have access token

So I am looking for to get all folders name with their respective folder Id.

I am using node-outlook library but I am not aware what APIs they have provided get only folders path and folder id.

Thanks

over 4 years ago · Santiago Trujillo
2 answers
Answer question

0

If you only want to get the folder name and folder Id, you can use the following api call:

$http.get("https://outlook.office.com/api/v2.0/me/MailFolders/$select=Id,ChildFolderCount,DisplayName")

Since the above api, only returns main folders, I strongly suggest that you also select ChildFolderCount and add a check in the response, if ChildFolderCount>0, then get the subfolders of the parent by the following call:

$http.get("https://outlook.office.com/api/v2.0/me/MailFolders/"+parent.Id+"/childfolders?$top="+parent.ChildFolderCount)

where parent is the folder with ChildFolderCount>0.

over 4 years ago · Santiago Trujillo Report

0

The folder resource has a DisplayName property, so that should get what you want. (Reference).

You can also explore the API over at https://oauthplay.azurewebsites.net/. For example, I did a GET on https://outlook.office.com/api/v2.0/me/mailfolders, and this is an example of the result:

{
  "Id": "AQMkAGZjYmY1ZTIwLWI1M2UtNGNkYS05MGQyLTQyMgBjYTliODJhNTIALgAAA6Ii1CwFSf1Ai6F6MypimPkBAGTbcv4AqpNHlH0kubDE5QwAAAIBDwAAAA==",
  "DisplayName": "Drafts",
  "ParentFolderId": "AQMkAGZjYmY1ZTIwLWI1M2UtNGNkYS05MGQyLTQyMgBjYTliODJhNTIALgAAA6Ii1CwFSf1Ai6F6MypimPkBAGTbcv4AqpNHlH0kubDE5QwAAAIBCAAAAA==",
  "ChildFolderCount": 0,
  "UnreadItemCount": 2,
  "TotalItemCount": 9
}
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!