Create driveRestoreArtifactsBulkAdditionRequest

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 driveRestoreArtifactsBulkAdditionRequest object associated with a oneDriveForBusinessRestoreSession.

The following steps describe how to create and manage a oneDriveForBusinessRestoreSession with bulk artifact additions.

  1. Create a new oneDriveForBusinessRestoreSession with empty payload.
  2. Create a new driveRestoreArtifactsBulkAdditionRequest object associated with a oneDriveForBusinessRestoreSession.
  3. Get the status of the driveRestoreArtifactsBulkAdditionRequest for the OneDrive for work or school restore session. The initial status upon creation is active and remains in this state until the oneDriveForBusinessRestoreSession is activated.
  4. Activate the oneDriveForBusinessRestoreSession created in the first step.
  5. Monitor the status of the driveRestoreArtifactsBulkAdditionRequest. When all the drives are added to the corresponding oneDriveForBusinessRestoreSession, the status of the driveRestoreArtifactsBulkAdditionRequest changes to completed. If any failures occur during resource resolution, the status changes to completedWithErrors.

This API is available in the following national cloud deployments.

Global service US Government L4 US Government L5 (DOD) China operated by 21Vianet

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 permission Higher privileged permissions
Delegated (work or school account) BackupRestore-Restore.ReadWrite.All Not available.
Delegated (personal Microsoft account) Not supported. Not supported.
Application BackupRestore-Restore.ReadWrite.All Not available.

HTTP request

POST /solutions/backupRestore/oneDriveForBusinessRestoreSessions/{oneDriveForBusinessRestoreSessionId}/driveRestoreArtifactsBulkAdditionRequests

Request headers

Name Description
Authorization Bearer {token}. Required. Learn more about authentication and authorization.
Content-Type application/json. Required.

Request body

In the request body, supply a JSON representation of the driveRestoreArtifactsBulkAdditionRequest object.

You can specify the following properties when you create a driveRestoreArtifactsBulkAdditionRequest object.

Property Type Description
directoryObjectIds String collection The list of directory object IDs. Optional.
drives String collection The list of OneDrive for work or school email addresses. Optional.

Response

If successful, this method returns a 201 Created response code and a driveRestoreArtifactsBulkAdditionRequest object in the response body.

For a list of possible error responses, see Backup Storage API error responses.

Examples

Request

The following example shows a request that adds a list of drives to the specified Onedrive for work or school restore session in a bulk operation.

POST https://graph.microsoft.com/beta/solutions/backupRestore/oneDriveForBusinessRestoreSessions/493635f0-b8c0-4c7f-bcb7-b20c85d97efe/driveRestoreArtifactsBulkAdditionRequests
Content-Type: application/json

{
  "displayName": "ODB-BulkRestoreArtifacts",
  "drives": [
    "contoso1@micorosft.com",
    "consotos2@microsoft.com",
    "contoso3@microsoft.com"
  ],
  "directoryObjectIds": [],
  "protectionUnitIds": [],
  "protectionTimePeriod": {
    "startDateTime": "2021-01-01T00:00:00Z",
    "endDateTime": "2021-01-08T00:00:00Z"
  },
  "destinationType": "new",
  "tags": "fastRestore",
  "restorePointPreference": "latest"
}

Response

The following example shows the response.

HTTP/1.1 201 Created
Content-Type: application/json

{
  "@odata.context": "/solutions/backupRestore/$metadata#siteRestoreArtifactsBulkAdditionRequest/$entity",
  "id": "9cf59538-5289-4024-9fa4-9c6c2b39aaa6",
  "destinationType": "new",
  "tags": "fastRestore",
  "restorePointPreference": "latest",
  "displayName": "ODB-BulkRestoreArtifacts",
  "status": "active",
  "createdDateTime": "2024-12-03T13:09:46.3725247Z",
  "lastModifiedDateTime": "2024-12-03T13:09:46.3725247Z",
  "drives": [],
  "protectionTimePeriod": {
    "startDateTime": "2024-11-26T00:00:00Z",
    "endDateTime": "2024-12-03T00:00:00Z"
  },
  "createdBy": {
    "user": {
      "identity": "fb70be35-8c8e-4c8a-b55d-f8cd95c5e23a"
    }
  },
  "lastModifiedBy": {
    "user": {
      "identity": "fb70be35-8c8e-4c8a-b55d-f8cd95c5e23a"
    }
  }
}