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 by item ID.

Request

POST https://<hostname>:4443/v4/RestoreSessions/{restoreSessionId}/Organization/Mailboxes/{mailboxId}/Items/{itemId}/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 Veeam Backup for Microsoft Office 365 entities to PST files (Personal Folder Files), you must have a 64-bit version of Microsoft Outlook 2016, Microsoft Outlook 2013 or Microsoft Outlook 2010 installed on the 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.

{

 "exportToPst": {

   "contentKeywords": "support",

   "EnablePstSizeLimit": true,

   "PstSizeLimitBytes": 1073741824

 }

}

The request command will export a backed up item to a PST file and place it 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 a backed up item 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.

For example:

{

"restoretoOriginallocation":

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

  "userPassword": "paSSw0rd"

 }

}

Restore to a different mailbox

To restore a backed up item to a different mailbox on the production Exchange 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 a mailbox item.

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 a backed up item as attachment in an email message to the same production 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 a backed up item as attachment 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 a restored mailbox item will be sent.

To

string

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

Subject

string

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

Text

string

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

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"

 }

}

Save as MSG

To save a backed up item to an MSG file (Outlook Message File), the request body must contain the savetoMsg action:

{

 "savetoMsg": null

}

The request command will save the backed up item with a specified ID to an MSG file and transfer it to application/octet-stream media. You can use Swagger UI to download the mailbox item 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 a 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 a backed up item 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/AAAAAKGE4dIvQUtGjuSnq8JTHAgHAPliTMf_6DxPiJ6TGYB9CqAAAAAAAUcAAEJD8-NHTuNAoFrJGmIzcMoAAE-h_u0AAA==/Action

 

Request Header:

Authorization: Bearer <Access-Token>

 

Request Body:

 

{

 "exporttoPst": null

}

 

Response:

200 OK

Example 2

The following request saves a backed up item to an MSG file.

Request:

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

 

Request Header:

Authorization: Bearer <Access-Token>

 

Request Body:

 

{

 "savetoMsg": null

}

 

Response:

200 OK

Example 3

The following request restores a backed up item to the same mailbox on the production Exchange server.

Request:

POST https://abc.tech.local:4443/v4/RestoreSessions/380d7caf-6294-4a33-b50a-b8aeb13af58c/Organization/Mailboxes/9e9b7199-f547-467a-b580-9d283a75eaad/Items/AAAAAKGE4dIvQUtGjuSnq8JTHAgHAPliTMf_6DxPiJ6TGYB9CqAAAAAAAUcAAEJD8-NHTuNAoFrJGmIzcMoAAE-h_u0AAA==/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 a backed up item to a different mailbox on the production Exchange server.

Request:

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

 

Request Header:

Authorization: Bearer <Access-Token>

 

Request Body:

 

{

 "restoreTo":

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

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

  "userPassword": "paSSw0rd"

 }

}

 

Response:

200 OK

Example 5

The following request sends a restored organization's mailbox item as attachment in the email message to the same production mailbox.

Request:

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

 

Request Header:

Authorization: Bearer <Access-Token>

 

Request Body:

 

{

 "sendtoDefaultaddress": null

}

 

Response:

200 OK

Example 6

The following request sends a restored organization's mailbox item as attachment in the email message to a different production mailbox.

Request:

POST https://abc.tech.local:4443/v4/RestoreSessions/380d7caf-6294-4a33-b50a-b8aeb13af58c/Organization/Mailboxes/9e9b7199-f547-467a-b580-9d283a75eaad/Items/AAAAAKGE4dIvQUtGjuSnq8JTHAgHAPliTMf_6DxPiJ6TGYB9CqAAAAAAAUcAAEJD8-NHTuNAoFrJGmIzcMoAAE-h_u0AAA==/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.