Veeam Backup for Microsoft Office 365 4.0
RESTful API Reference
Related documents

Exporting, Restoring, Sending and Saving Mailbox Items

This section explains how to export, restore, send and save backed up items.

Request

POST https://<hostname>:4443/v4/RestoreSessions/{restoreSessionId}/Organization/Mailboxes/{mailboxId}/Items/Action

Request Headers

The request header must contain an authorization token of the current session.

Request Body

Export to PST

Exporting, Restoring, Sending and Saving Mailbox Items Important!

To export data to .pst files, you must have a 64-bit version of Microsoft Outlook 2016, Microsoft Outlook 2013 or Microsoft Outlook 2010 installed on a computer running restore sessions.

To export backed up items from the organization mailbox to a Personal Folder File (PST), the request body must contain the exportToPst action.

Property

Type

Description

ContentKeywords

string

Sets the keyword to query backed-up mailbox data.

EnablePstSizeLimit

boolean

Defines whether to set the size limit for the exported .pst file.

If set to true, make sure to specify the PstSizeLimitBytes parameter.

PstSizeLimitBytes

integer

Sets the limit of the exported .pst file.

You can choose the limit range from 1GB to 49GB.

For example:

{

 "exportToPst": {

   "contentKeywords": "support",

   "EnablePstSizeLimit": true,

   "PstSizeLimitBytes": 1073741824

 }

}

The request command will look for a specified keyword in item names and fields inside the organization's mailbox. The backed up data with a specified keyword then will be exported to a PST file and placed to a temporary folder on the Veeam Backup for Microsoft Office 365 server. After that, the PST file will be transferred as application/octet-stream media to the client. To download, read, convert to PST or perform other actions with the octet-stream, use features of programming languages.

Exporting, Restoring, Sending and Saving Mailbox Items Tip:

You can use Swagger UI to download the octet-stream file by clicking the Download action link, which server returns in the response body after a successfully completed export operation.

Restore to the same mailbox

To restore backed up items to the same mailbox on the production Exchange server, the request body must contain the restoretoOriginallocation action properties:

Property

Type

Description

UserName

string

Specifies the user name you want to use for authenticating with the Exchange organization.

UserPassword

string

Specifies the user name you want to use for authenticating with the Exchange organization.

Items

Items

Specifies the IDs of mailbox items that you want to restore. If you omit this parameter, all backed up items will be restored to the same mailbox on the production Exchange server.

For example:

{

"restoretoOriginallocation":

 {"userName": "jsmith@westsupport.onmicrosoft.com",

  "userPassword": "paSSw0rd"

  "items":  [

   {"Id": "74685f6b-16aa-4a78-a44f-05526ce0ae30"},

   {"Id": "70013a9e-c446-429d-aa78-9c8c20d9b814"}

   ]

 }

}

Restore to a different mailbox

To restore backed up items to a different mailbox on the production server, the request body must contain the restoreTo action properties:

Property

Type

Description

Mailbox

string

Specifies the email address of the mailbox to which you want to restore mailbox items.

UserName

string

Specifies the user name you want to use for authenticating with the Exchange organization.

UserPassword

string

Specifies the user name you want to use for authenticating with the Exchange organization.

For example:

{

 "restoreTo":

 {"mailbox": "johnsmith@westsupport.onmicrosoft.com",

  "userName": "jsmith@westsupport.onmicrosoft.com",

  "userPassword": "paSSw0rd"

 }

}

Send to the same mailbox

To send backed up items as attachments in an email message to the same mailbox, the request body must contain the sendtoDefaultaddress action:

{

 "sendtoDefaultaddress": null

}

 

Exporting, Restoring, Sending and Saving Mailbox Items Note:

To be able to send items as attachments you must specify the VEX email settings by sending PUT HTTPS request to the /VEXEmailSettings URL. For more information, see (PUT) /VEXEmailSettings.

Send to a different mailbox

To send backed up items as attachments in an email message to a different mailbox, the request body must contain the sendtoDifferentaddress action properties:

Property

Type

Description

From

string

Specifies the email address from which the restored mailbox items will be sent.

To

string

Specifies the email address to which the restored mailbox items will be sent.

Subject

string

Specifies the subject of the email message used for sending restored mailbox items.

Text

string

Specifies the body of the email message used for sending restored mailbox items.

For example:

{

 "sendtoDifferentaddress":

 {"from": "j_smith@bestsupport.onmicrosoft.com",

  "to": "r.clark@bestsupport.onmicrosoft.com",

  "subject": "Support Tickets",

  "text": "Please find attached the files you requested"

 }

}

 

Exporting, Restoring, Sending and Saving Mailbox Items Note:

If you omit the From property, the default "from" email address specified in VEX email settings will be used. To specify VEX email settings, send PUT HTTPS request to the /VEXEmailSettings URL. For more information, see (PUT) /VEXEmailSettings.

Save as MSG

To save backed up organization's mailbox items to MSG files (Outlook Message Files), the request body must contain the savetoMsg action property:

Property

Type

Description

ContentKeywords

string

Specifies the keyword to query backed up mailbox items.

For example:

{

 "savetoMsg":

 {"contentKeywords": "support"

 }

}

The request command will look for a specified keyword in item fields inside the organization's mailbox. After that the backed up items with a specified keywords will be saved to MSG files and transferred to application/octet-stream media. You can use Swagger UI to download the mailbox items in MSG format from the stream by clicking the "Download action" link in the response body.

Response

The server returns the following response to the client.

Response Codes

A successfully completed operation returns response code 200 OK.

Response Headers

The response to this request contains the following headers. The response may also include additional standard HTTPS headers.

Header

Description

Content-length

The length of the response body.

Content-type

The media type and syntax of the request body message for the requests with the export and save actions: application/octet-stream.

The media type and syntax of the request body message for the requests with the restore and send actions: null.

Response Body

None.

Example 1

The following request exports backed up mailbox items containing "support" keyword to a PST file.

Request:

POST https://abc.tech.local:4443/v4/RestoreSessions/380d7caf-6294-4a33-b50a-b8aeb13af58c/Organization/Mailboxes/9e9b7199-f547-467a-b580-9d283a75eaad/Items/Action

 

Request Header:

Authorization: Bearer <Access-Token>

 

Request Body:

{

 "exportToPst": {

   "contentKeywords": "support",

   "EnablePstSizeLimit": true,

   "PstSizeLimitBytes": 1073741824

 }

}

Response:

200 OK

Example 2

The following request saves backed up mailbox items containing "support" keyword to MSG files.

Request:

POST https://abc.tech.local:4443/v4/RestoreSessions/380d7caf-6294-4a33-b50a-b8aeb13af58c/Organization/Mailboxes/9e9b7199-f547-467a-b580-9d283a75eaad/Items/Action

 

Request Header:

Authorization: Bearer <Access-Token>

 

Request Body:

 

{

 "savetoMsg":

 {"contentKeywords": "support"

 }

}

 

Response:

200 OK

Example 3

The following request restores backed up mailbox items to the same mailbox on the production server.

Request:

POST https://abc.tech.local:4443/v4/RestoreSessions/380d7caf-6294-4a33-b50a-b8aeb13af58c/Organization/Mailboxes/9e9b7199-f547-467a-b580-9d283a75eaad/Items/Action

 

Request Header:

Authorization: Bearer <Access-Token>

 

Request Body:

 

{

"restoretoOriginallocation":

 {"userName": "jsmith@westsupport.onmicrosoft.com",

  "userPassword": "paSSw0rd"

 }

}

 

Response:

200 OK

Example 4

The following request restores backed up mailbox items to a different mailbox on the production server.

Request:

POST https://abc.tech.local:4443/v4/RestoreSessions/380d7caf-6294-4a33-b50a-b8aeb13af58c/Organization/Mailboxes/9e9b7199-f547-467a-b580-9d283a75eaad/Items/Action

Request Header:

Authorization: Bearer <Access-Token>

 

Request Body:

 

{

 "restoreTo":

 {"userPassword": "Pa$$w0rd",

  "userName": "administrator@westsupport.onmicrosoft.com",

  "mailbox": "djohnes@westsupport.onmicrosoft.com",

 }

}

 

Response:

200 OK

Example 5

The following request sends restored mailbox items as attachments in the email message to the same mailbox.

Request:

POST https://abc.tech.local:4443/v4/RestoreSessions/380d7caf-6294-4a33-b50a-b8aeb13af58c/Organization/Mailboxes/9e9b7199-f547-467a-b580-9d283a75eaad/Items/Action

 

Request Header:

Authorization: Bearer <Access-Token>

 

Request Body:

 

{

 "sendtoDefaultaddress": null

}

 

Response:

200 OK

Example 6

The following request sends restored mailbox items as attachments in the email message to a different mailbox.

Request:

POST https://abc.tech.local:4443/v4/RestoreSessions/380d7caf-6294-4a33-b50a-b8aeb13af58c/Organization/Mailboxes/9e9b7199-f547-467a-b580-9d283a75eaad/Items/Action

 

Request Header:

Authorization: Bearer <Access-Token>

 

Request Body:

 

{

 "sendtoDifferentaddress":

 {"from": "j_smith@bestsupport.onmicrosoft.com",

  "to": "r.clark@bestsupport.onmicrosoft.com",

  "subject": "Support Tickets",

  "text": "Please find attached the files you requested"

 }

}

 

Response:

200 OK

This Document Help Center
User GuideRESTful API ReferencePowerShell ReferenceVeeam Explorers User GuideVeeam Explorers PowerShell Reference
I want to report a typo

There is a misspelling right here:

 

I want to let the Veeam Documentation Team know about that.