List imports
GET
/mailboxes/{id}/importsLists a mailbox’s imports, newest first, and how far each has got.
Needs the permissionimports:list
percent is measured against what the import will actually go through, counted when it starts. Until then it’s null, not 0.
With ?folders=1 you also get the folders on the mail server, to choose what to import. That opens a connection to the server and takes a few seconds, so ask once, not on every poll. If it fails, the imports still come back, with the reason in folderError.
Path parameters
idstringrequired- The mailbox.
Query parameters
foldersstringoptional1to list the server’s folders as well.
Returns
A list of imports, each with:
idstring- The import.
statusstringqueued,running,stopping,doneorfailed.folderslist of strings- What it imports.
sincestring or null- The oldest mail it takes, or null for all of it.
processednumber- Messages gone through so far, out of
totalonce that’s counted. percentnumber or null- How far it’s got.
importednumber- Messages added.
skippedcounts the ones it left, usually because DMU Mail had them already, anderrorsthe ones that failed. lastErrorstring or null- The last thing that went wrong.
startedAtstring- With
finishedAt, which is null until it ends. folderslist- Next to
data, with?folders=1: each folder’spath, itsroleand its number ofmessages.
Errors
401invalid_key- The key is wrong, expired or revoked. With no Authorization header at all, the code is
missing_credentials. 403missing_scope- The key doesn’t have
imports:list. TheX-Required-Scopeheader names what’s missing. 429rate_limited- More than 120 requests a minute from this key. Wait for
Retry-Afterseconds.