mailbox: createImportSession
Namespace: microsoft.graph
Important
APIs under the /beta
version in Microsoft Graph are subject to change. Use of these APIs in production applications is not supported. To determine whether an API is available in v1.0, use the Version selector.
Create a session to import an Exchange mailbox item using its FastTransfer stream (FTS) format.
Permissions
Choose the permission or permissions marked as least privileged for this API. Use a higher privileged permission or permissions only if your app requires it. For details about delegated and application permissions, see Permission types. To learn more about these permissions, see the permissions reference.
Permission type | Least privileged permissions | Higher privileged permissions |
---|---|---|
Delegated (work or school account) | MailboxItem.ImportExport | Not available. |
Delegated (personal Microsoft account) | Not supported. | Not supported. |
Application | MailboxItem.ImportExport.All | Not available. |
HTTP request
POST /admin/exchange/mailboxes/{mailboxId}/createImportSession
Request headers
Name | Description |
---|---|
Authorization | Bearer {token}. Required. Learn more about authentication and authorization. |
Request body
Don't supply a request body for this method.
Response
If successful, this action returns a 200 OK
response code and a mailboxItemImportSession in the response body.
Examples
Request
The following example shows how to create an import session. The opaque URL, returned in the importUrl property of the response, is preauthenticated and contains the appropriate authorization token for subsequent POST queries in the https://outlook.office365.com domain. That token expires by expirationDateTime. Don't customize this URL for subsequent POST operations.
POST https://graph.microsoft.com/beta/admin/exchange/mailboxes/MBX:e0643f21@a7809c93/createImportSession
Response
The following example shows the response.
Note: The response object shown here might be shortened for readability.
HTTP/1.1 200 OK
Content-type: application/json
Content-length: 232
{
"@odata.context": "https://graph.microsoft.com/beta/$metadata#microsoft.graph.mailboxItemImportSession",
"importUrl": "https://outlook.office365.com/api/gbeta/Mailboxes('MBX:e0643f21@a7809c93')/importItem?authtoken=eyJhbGciOiJSUzI1NiIsImtpZCI6IjFTeXQ1b",
"expirationDateTime": "2024-10-17T19:00:48.1052906Z"
}