Help Center
Choose product document...
Veeam Backup for Microsoft Office 365 2.0
RESTful API Reference

(POST) /RestoreSessions/{ID}/Organization/Mailboxes/{ID}/Items/Action

Exports, restores, sends and saves backed up items from the organization's mailbox.

Request

To perform restore operations with backed up mailbox items, send the POST HTTPS request to the URL of the /RestoreSessions/{ID}/Organization/Mailboxes/{ID}/Items/Action resource.

HTTPS Request

POST https://<Backup-Office365>:4443/v2/RestoreSessions/{ID}/Organization/Mailboxes/{ID}/Items/Action

Request Headers

The request contains the following headers:

Header

Required

Description

Content-Type: application/json

true

Specifies the type of the content for your request.

Authorization: Bearer <Access-Token>

true

The request header must contain the authorization token for the current logon session.

Request Body

Export to PST

(POST) /RestoreSessions/{ID}/Organization/Mailboxes/{ID}/Items/Action 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 the backed up items from the organization's mailbox to a PST file (Personal Folder File), the request body must contain the exporttoPst action property:

Property

Type

Description

ContentKeywords

string

Specifies the keyword to query backed up mailbox items.

For example, "сontentKeywords": "support".

For example:

{

 "exporttoPst":

 {"contentKeywords": "support"

 }

}

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.

(POST) /RestoreSessions/{ID}/Organization/Mailboxes/{ID}/Items/Action 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.

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

UserPassword

string

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

For example, "userPassword": "paSSw0rd".

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, ["items": {"Id": "74685f6b-16aa-4a78-a44f-05526ce0ae30"}, {"Id": "70013a9e-c446-429d-aa78-9c8c20d9b814"} ].

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.

For example, "mailbox": "djohnes@northsupport.onmicrosoft.com".

UserName

string

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

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

UserPassword

string

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

For example, "userPassword": "paSSw0rd".

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

}

 

(POST) /RestoreSessions/{ID}/Organization/Mailboxes/{ID}/Items/Action 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.

For example, "from": "j_smith@bestsupport.onmicrosoft.com".

To

string

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

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

Subject

string

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

For example,  "subject": "Support Tickets".

Text

string

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

For example, "text": "Please find attached the files you requested".

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"

 }

}

 

(POST) /RestoreSessions/{ID}/Organization/Mailboxes/{ID}/Items/Action 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, "сontentKeywords": "support".

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://support.east.local:4443/v2/RestoreSessions/380d7caf-6294-4a33-b50a-b8aeb13af58c/Organization/Mailboxes/9e9b7199-f547-467a-b580-9d283a75eaad/Items/Action

 

Request Header:

Content-Type: application/json

Authorization: Bearer <Access-Token>

 

Request Body:

 

{

 "exporttoPst":

 {"contentKeywords": "support"

 }

}

 

Response:

200 OK

Example 2

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

Request:

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

 

Request Header:

Content-Type: application/json

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://support.east.local:4443/v2/RestoreSessions/380d7caf-6294-4a33-b50a-b8aeb13af58c/Organization/Mailboxes/9e9b7199-f547-467a-b580-9d283a75eaad/Items/Action

 

Request Header:

Content-Type: application/json

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://support.east.local:4443/v2/RestoreSessions/380d7caf-6294-4a33-b50a-b8aeb13af58c/Organization/Mailboxes/9e9b7199-f547-467a-b580-9d283a75eaad/Items/Action

Request Header:

Content-Type: application/json

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://support.east.local:4443/v2/RestoreSessions/380d7caf-6294-4a33-b50a-b8aeb13af58c/Organization/Mailboxes/9e9b7199-f547-467a-b580-9d283a75eaad/Items/Action

 

Request Header:

Content-Type: application/json

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://support.east.local:4443/v2/RestoreSessions/380d7caf-6294-4a33-b50a-b8aeb13af58c/Organization/Mailboxes/9e9b7199-f547-467a-b580-9d283a75eaad/Items/Action

 

Request Header:

Content-Type: application/json

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

Veeam Large Logo

User Guide

RESTful API Reference

PowerShell Reference