Zur Dokumentation springen
Java

client.exports()

Jede Methode in diesem Namespace: ihre Signatur, ihre Parameter, was sie zurückgibt und ein Beispiel.

Methoden

A zip of the whole workspace, as the Export page makes it: see what it would hold, start one, follow it while it is made and download it once it is ready.

exports().preview

See what an export would hold

Geltungsbereichethreads:read
Signatur
Map<String, Object> preview(RequestOptions options)

Returns whether the workspace can be exported by the caller now, when the next export can start, the export still being made, if there is one, and how much an export would hold: conversations, attachments and their size, contacts, audiences, calendar events, templates, rules, labels, notes and addresses. When allowed is false, reason says why and counts is null.

Only the workspace owner, or a member whose role holds every permission, can export the workspace: an API key, or an access token connected with every address. A key or token limited to particular addresses or domains is 422 capability_unsupported, and an account the workspace cannot export for is 403 export_not_permitted.

Parameter

options.apiKeyString

Overrides the client's API key for this call only.

Rückgabe

A map with allowed, reason, nextAvailableAt, activeExportId and counts, a map of threads, attachments, attachmentBytes, deletedFiles, contacts, audiences, calendarEvents, templates, rules, labels, notes and addresses.

Beispiel

Map<String, Object> preview = client.exports().preview(); System.out.println(preview.get("allowed") + " " + preview.get("nextAvailableAt") + " " + preview.get("counts"));

Hinweise

  • reason is not-permitted, mailbox-login or two-factor-required.

Auch verfügbar über

API
GET /exports/preview
TypeScript
exports.preview()
Python
exports.preview()
Ruby
exports.preview
PHP
exports->preview
Go
Exports.Preview
C#
Exports.PreviewAsync
CLI
openemail exports preview

exports().list

List the exports

Geltungsbereichethreads:read
Signatur
Map<String, Object> list(RequestOptions options)

Returns every export of the workspace, newest first, a page at a time, with its status, its progress through the conversations and, once it is ready, its size, file name and when it is deleted.

Only the workspace owner, or a member whose role holds every permission, can export the workspace: an API key, or an access token connected with every address. A key or token limited to particular addresses or domains is 422 capability_unsupported, and an account the workspace cannot export for is 403 export_not_permitted.

Parameter

options.limitint

Exports per page, from 1 to 100. The server defaults to 25.

options.offsetint

How many exports to skip.

options.apiKeyString

Overrides the client's API key for this call only.

Rückgabe

A map, not a Page, with data, a list of export maps shaped like the one exports().get returns, plus total and hasMore. Ask for the next page with offset.

Beispiel

Map<String, Object> result = client.exports().list(); System.out.println(result.get("object") + " " + result.get("total"));

Hinweise

  • A workspace can be exported once a day, and each export is kept for a year, so the list stays short.

Auch verfügbar über

API
GET /exports
TypeScript
exports.list()
Python
exports.list()
Ruby
exports.list
PHP
exports->list
Go
Exports.List
C#
Exports.ListAsync
CLI
openemail exports list

exports().get

Retrieve an export

Geltungsbereichethreads:read
Signatur
Map<String, Object> get(String id, RequestOptions options)

Returns one export: its status, phase and progress while it is made, and once it is ready its size, file name and when it is deleted.

Only the workspace owner, or a member whose role holds every permission, can export the workspace: an API key, or an access token connected with every address. A key or token limited to particular addresses or domains is 422 capability_unsupported, and an account the workspace cannot export for is 403 export_not_permitted.

Parameter

idStringErforderlich

The export id from exports().start or exports().list.

options.apiKeyString

Overrides the client's API key for this call only.

Rückgabe

A map with id, status, phase, createdAt, createdBy, startedAt, finishedAt, expiresAt, sizeBytes, fileName, threadsDone, threadsTotal and error.

Beispiel

Map<String, Object> item = client.exports().get("exp_8c1e4a7f2b9d3e6a0c5f1b28"); System.out.println(item.get("status") + " " + item.get("threadsDone") + " " + item.get("threadsTotal"));

Hinweise

  • An unknown id is a 404.

Auch verfügbar über

API
GET /exports/{id}
TypeScript
exports.get()
Python
exports.get()
Ruby
exports.get
PHP
exports->get
Go
Exports.Get
C#
Exports.GetAsync
CLI
openemail exports get

exports().start

Start an export

Geltungsbereichethreads:read
Signatur
Map<String, Object> start(RequestOptions options)

Starts making a zip of the whole workspace, as Export now on the Export page does, and returns the export, queued. It is made in the background: poll exports().get until status is ready, then exports().download it. One export runs at a time, and a workspace can be exported once a day.

Only the workspace owner, or a member whose role holds every permission, can export the workspace: an API key, or an access token connected with every address. A key or token limited to particular addresses or domains is 422 capability_unsupported, and an account the workspace cannot export for is 403 export_not_permitted.

Parameter

options.apiKeyString

Overrides the client's API key for this call only.

Rückgabe

A map for the new export, shaped like the one exports().get returns.

Beispiel

Map<String, Object> started = client.exports().start(); System.out.println(started.get("id") + " " + started.get("status"));

Hinweise

  • With an OAuth access token it asks for a verification code: until the app has verified one, it is refused with 403 step_up_required. An API key is never asked.

  • An export already being made is 409 already_running, and a workspace exported in the last day is 429 export_limit_reached.

  • The SDK does not retry it.

Auch verfügbar über

API
POST /exports
TypeScript
exports.start()
Python
exports.start()
Ruby
exports.start
PHP
exports->start
Go
Exports.Start
C#
Exports.StartAsync
CLI
openemail exports start

exports().download

Download an export

Geltungsbereichethreads:read
Signatur
byte[] download(String id, RequestOptions options)

Returns the zip of a ready export, the same file the Download action on the Export page saves.

Only the workspace owner, or a member whose role holds every permission, can export the workspace: an API key, or an access token connected with every address. A key or token limited to particular addresses or domains is 422 capability_unsupported, and an account the workspace cannot export for is 403 export_not_permitted.

Parameter

idStringErforderlich

The export id from exports().start or exports().list.

options.apiKeyString

Overrides the client's API key for this call only.

Rückgabe

A string holding the bytes of the zip.

Beispiel

Map<String, Object> item = client.exports().get("exp_8c1e4a7f2b9d3e6a0c5f1b28"); byte[] zip = client.exports().download((String) item.get("id")); System.out.println(zip.length + " bytes");

Hinweise

  • With an OAuth access token it asks for a verification code: until the app has verified one, it is refused with 403 step_up_required. An API key is never asked.

  • Before the export is ready the call is 409 export_not_ready, and an export older than a year is 409 expired.

  • The whole zip is held in memory, and a large workspace makes a large zip.

Auch verfügbar über

API
GET /exports/{id}/content
TypeScript
exports.download()
Python
exports.download()
Ruby
exports.download
PHP
exports->download
Go
Exports.Download
C#
Exports.DownloadAsync
CLI
openemail exports download