OneDrive for Business Connection Using REST API
Creating a Connection
You will need to add the relevant connection information into the GET request. The following GET will return a Microsoft login link. Use the link to complete logging into the account and to grant DryvIQ access to the account.Â
GET {{url}}v1/connections/platforms/onedrive-business-graph/new?domain={{YOUR URL}}&name={{YOUR CONNECTION NAME}}&client_id={{YOUR CLIENT ID}}&client_secret={{YOUR CLIENT SECRET}}
Â
Creating a Job Using Impersonation
As a OneDrive for Business administrator, you can impersonate a user using the path that relates to their content. Then, use their information in the impersonate_as block. (See Impersonation for more information on how to impersonate users.)
{
"name":"Basic job with impersonation",
"kind": "transfer",
"transfer": {
"audit_level": "trace",
"transfer_type": "copy",
"source": {
"connection": { "id": "{{nfs_source_connectionID}}" },
"target": {
"path": "/sourcePath"
}
},
"destination": {
"connection": { "id": "{{OneDriveforBusiness_destination_connectionID}}" },
"impersonate_as": {
"id": "00",
"name": "Joe Smith",
"email": "jsmith@company.onmicrosoft.com"
},
"target": {
"path": "/destinationPath"
}
},
"simulation_mode": false
},
"schedule": {
"mode": "manual"
},
"stop_policy": {
"on_success": 5,
"on_failure": 5,
"on_execute": 25
},
"category": {
"name": "Report | Impersonation Job Examples"
}
}
Â
Â
Â
Â