0

I'm using Outook REST API v1, and try to get all folders with https://outlook.office.com/api/v1.0/me/folders. But response I got not has Folder Type or something like that, I can use DisplayName to know type of folder. But DisplayName different when using different language. So, what I wonder, can we decode the folder's ID or something to know type of folder. Can someone help me? Thank you !

Hom nom nom nom ...
  • 479
  • 1
  • 5
  • 14
  • Can you explain what you mean by type? Do you mean what kind of items they hold, or are you looking for something else? – Jason Johnston Apr 04 '16 at 21:38
  • @JasonJohnston Yes, I want to know kind of items they hold, more details, I want to know, which is Draft folder, Inbox folder, Outbox folder ... . without using `DisplayName`, because `DisplayName` different when using other Outlook language. – Hom nom nom nom ... Apr 05 '16 at 02:10

2 Answers2

1

Yes, after changing timezone/language in mailbox settings ,the DisplayName of the original mailboxes(such as Inbox,Drafts..) will also be changed , but you can use the following well-known names to access the corresponding folder: Inbox, Drafts, SentItems, DeletedItems. For example :

https://outlook.office.com/api/v1.0/me/folders/Drafts

above GET request will get the resources of the Drafts .

Hope it helps.

Nan Yu
  • 26,101
  • 9
  • 68
  • 148
  • Thanks bro. Some my customers have special folder name, ex : Send Messages, Deleted Messages... I don't know why did they have them. Now I don't have their accounts, so can't test will folders/SendItems and folders/SendMessages are one. – Hom nom nom nom ... Apr 06 '16 at 01:11
1

In addition to Nan's answer, we've added a new property on the /beta endpoint called WellKnownName, which will give you the corresponding well-known URL segment for a folder, assuming it is one of the special folders. For example:

GET https://outlook.office.com/api/beta/me/mailfolders/

{
  "Id": "AQMkADAwATE0YzYwLWU2YWQtMzI2MS0wMAItMDAKAC4AAAPlai60KwU4RaQaBohCjrEVAQDChncDEyhVQLMhyjJAPQSqAAACAQwAAAA=",
  "DisplayName": "Inbox",
  "ParentFolderId": "AQMkADAwATE0YzYwLWU2YWQtMzI2MS0wMAItMDAKAC4AAAPlai60KwU4RaQaBohCjrEVAQDChncDEyhVQLMhyjJAPQSqAAACAQgAAAA=",
  "ChildFolderCount": 0,
  "UnreadItemCount": 39,
  "TotalItemCount": 8174,
  "WellKnownName": "inbox"
},
{
  "Id": "AQMkADAwATE0YzYwLWU2YWQtMzI2MS0wMAItMDAKAC4AAAPlai60KwU4RaQaBohCjrEVAQDChncDEyhVQLMhyjJAPQSqAAACAT4AAAA=",
  "DisplayName": "Jobs",
  "ParentFolderId": "AQMkADAwATE0YzYwLWU2YWQtMzI2MS0wMAItMDAKAC4AAAPlai60KwU4RaQaBohCjrEVAQDChncDEyhVQLMhyjJAPQSqAAACAQgAAAA=",
  "ChildFolderCount": 0,
  "UnreadItemCount": 0,
  "TotalItemCount": 6,
  "WellKnownName": null
}

The first folder above is the Inbox (WellKnownName = inbox), and the second folder is a user-created folder (WellKnownName = null).

Jason Johnston
  • 17,194
  • 2
  • 20
  • 34