Namespace: microsoft.graph
Note: The Microsoft Graph API for Intune requires an active Intune license for the tenant.
Update the properties of a deviceManagementExportJob object.
This API is available in the following national cloud deployments.
Global service |
US Government L4 |
US Government L5 (DOD) |
China operated by 21Vianet |
✅ |
✅ |
✅ |
✅ |
Permissions
One of the following permissions is required to call this API. To learn more, including how to choose permissions, see Permissions.
Permission type |
Permissions (from least to most privileged) |
Delegated (work or school account) |
DeviceManagementConfiguration.ReadWrite.All, DeviceManagementApps.ReadWrite.All, DeviceManagementManagedDevices.ReadWrite.All |
Delegated (personal Microsoft account) |
Not supported. |
Application |
DeviceManagementConfiguration.ReadWrite.All, DeviceManagementApps.ReadWrite.All, DeviceManagementManagedDevices.ReadWrite.All |
HTTP Request
PATCH /deviceManagement/reports/exportJobs/{deviceManagementExportJobId}
Request body
In the request body, supply a JSON representation for the deviceManagementExportJob object.
The following table shows the properties that are required when you create the deviceManagementExportJob.
Property |
Type |
Description |
id |
String |
Unique identifier for this entity |
reportName |
String |
Name of the report |
filter |
String |
Filters applied on the report |
select |
String collection |
Columns selected from the report |
format |
deviceManagementReportFileFormat |
Format of the exported report. Possible values are: csv , pdf , json , unknownFutureValue . |
snapshotId |
String |
A snapshot is an identifiable subset of the dataset represented by the ReportName. A sessionId or CachedReportConfiguration id can be used here. If a sessionId is specified, Filter, Select, and OrderBy are applied to the data represented by the sessionId. Filter, Select, and OrderBy cannot be specified together with a CachedReportConfiguration id. |
localizationType |
deviceManagementExportJobLocalizationType |
Configures how the requested export job is localized. Possible values are: localizedValuesAsAdditionalColumn , replaceLocalizableValues . |
status |
deviceManagementReportStatus |
Status of the export job. Possible values are: unknown , notStarted , inProgress , completed , failed . |
url |
String |
Temporary location of the exported report |
requestDateTime |
DateTimeOffset |
Time that the exported report was requested |
expirationDateTime |
DateTimeOffset |
Time that the exported report expires |
Response
If successful, this method returns a 200 OK
response code and an updated deviceManagementExportJob object in the response body.
Example
Request
Here is an example of the request.
PATCH https://graph.microsoft.com/v1.0/deviceManagement/reports/exportJobs/{deviceManagementExportJobId}
Content-type: application/json
Content-length: 455
{
"@odata.type": "#microsoft.graph.deviceManagementExportJob",
"reportName": "Report Name value",
"filter": "Filter value",
"select": [
"Select value"
],
"format": "pdf",
"snapshotId": "Snapshot Id value",
"localizationType": "replaceLocalizableValues",
"status": "notStarted",
"url": "Url value",
"requestDateTime": "2017-01-01T00:03:07.1589002-08:00",
"expirationDateTime": "2016-12-31T23:57:57.2481234-08:00"
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Models;
var requestBody = new DeviceManagementExportJob
{
OdataType = "#microsoft.graph.deviceManagementExportJob",
ReportName = "Report Name value",
Filter = "Filter value",
Select = new List<string>
{
"Select value",
},
Format = DeviceManagementReportFileFormat.Pdf,
SnapshotId = "Snapshot Id value",
LocalizationType = DeviceManagementExportJobLocalizationType.ReplaceLocalizableValues,
Status = DeviceManagementReportStatus.NotStarted,
Url = "Url value",
RequestDateTime = DateTimeOffset.Parse("2017-01-01T00:03:07.1589002-08:00"),
ExpirationDateTime = DateTimeOffset.Parse("2016-12-31T23:57:57.2481234-08:00"),
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.DeviceManagement.Reports.ExportJobs["{deviceManagementExportJob-id}"].PatchAsync(requestBody);
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation.
mgc device-management reports export-jobs patch --device-management-export-job-id {deviceManagementExportJob-id} --body '{\
"@odata.type": "#microsoft.graph.deviceManagementExportJob",\
"reportName": "Report Name value",\
"filter": "Filter value",\
"select": [\
"Select value"\
],\
"format": "pdf",\
"snapshotId": "Snapshot Id value",\
"localizationType": "replaceLocalizableValues",\
"status": "notStarted",\
"url": "Url value",\
"requestDateTime": "2017-01-01T00:03:07.1589002-08:00",\
"expirationDateTime": "2016-12-31T23:57:57.2481234-08:00"\
}\
'
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation.
// Code snippets are only available for the latest major version. Current major version is $v1.*
// Dependencies
import (
"context"
"time"
msgraphsdk "github.com/microsoftgraph/msgraph-sdk-go"
graphmodels "github.com/microsoftgraph/msgraph-sdk-go/models"
//other-imports
)
requestBody := graphmodels.NewDeviceManagementExportJob()
reportName := "Report Name value"
requestBody.SetReportName(&reportName)
filter := "Filter value"
requestBody.SetFilter(&filter)
select := []string {
"Select value",
}
requestBody.SetSelect(select)
format := graphmodels.PDF_DEVICEMANAGEMENTREPORTFILEFORMAT
requestBody.SetFormat(&format)
snapshotId := "Snapshot Id value"
requestBody.SetSnapshotId(&snapshotId)
localizationType := graphmodels.REPLACELOCALIZABLEVALUES_DEVICEMANAGEMENTEXPORTJOBLOCALIZATIONTYPE
requestBody.SetLocalizationType(&localizationType)
status := graphmodels.NOTSTARTED_DEVICEMANAGEMENTREPORTSTATUS
requestBody.SetStatus(&status)
url := "Url value"
requestBody.SetUrl(&url)
requestDateTime , err := time.Parse(time.RFC3339, "2017-01-01T00:03:07.1589002-08:00")
requestBody.SetRequestDateTime(&requestDateTime)
expirationDateTime , err := time.Parse(time.RFC3339, "2016-12-31T23:57:57.2481234-08:00")
requestBody.SetExpirationDateTime(&expirationDateTime)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
exportJobs, err := graphClient.DeviceManagement().Reports().ExportJobs().ByDeviceManagementExportJobId("deviceManagementExportJob-id").Patch(context.Background(), requestBody, nil)
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation.
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
DeviceManagementExportJob deviceManagementExportJob = new DeviceManagementExportJob();
deviceManagementExportJob.setOdataType("#microsoft.graph.deviceManagementExportJob");
deviceManagementExportJob.setReportName("Report Name value");
deviceManagementExportJob.setFilter("Filter value");
LinkedList<String> select = new LinkedList<String>();
select.add("Select value");
deviceManagementExportJob.setSelect(select);
deviceManagementExportJob.setFormat(DeviceManagementReportFileFormat.Pdf);
deviceManagementExportJob.setSnapshotId("Snapshot Id value");
deviceManagementExportJob.setLocalizationType(DeviceManagementExportJobLocalizationType.ReplaceLocalizableValues);
deviceManagementExportJob.setStatus(DeviceManagementReportStatus.NotStarted);
deviceManagementExportJob.setUrl("Url value");
OffsetDateTime requestDateTime = OffsetDateTime.parse("2017-01-01T00:03:07.1589002-08:00");
deviceManagementExportJob.setRequestDateTime(requestDateTime);
OffsetDateTime expirationDateTime = OffsetDateTime.parse("2016-12-31T23:57:57.2481234-08:00");
deviceManagementExportJob.setExpirationDateTime(expirationDateTime);
DeviceManagementExportJob result = graphClient.deviceManagement().reports().exportJobs().byDeviceManagementExportJobId("{deviceManagementExportJob-id}").patch(deviceManagementExportJob);
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation.
const options = {
authProvider,
};
const client = Client.init(options);
const deviceManagementExportJob = {
'@odata.type': '#microsoft.graph.deviceManagementExportJob',
reportName: 'Report Name value',
filter: 'Filter value',
select: [
'Select value'
],
format: 'pdf',
snapshotId: 'Snapshot Id value',
localizationType: 'replaceLocalizableValues',
status: 'notStarted',
url: 'Url value',
requestDateTime: '2017-01-01T00:03:07.1589002-08:00',
expirationDateTime: '2016-12-31T23:57:57.2481234-08:00'
};
await client.api('/deviceManagement/reports/exportJobs/{deviceManagementExportJobId}')
.update(deviceManagementExportJob);
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation.
<?php
use Microsoft\Graph\GraphServiceClient;
use Microsoft\Graph\Generated\Models\DeviceManagementExportJob;
use Microsoft\Graph\Generated\Models\DeviceManagementReportFileFormat;
use Microsoft\Graph\Generated\Models\DeviceManagementExportJobLocalizationType;
use Microsoft\Graph\Generated\Models\DeviceManagementReportStatus;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new DeviceManagementExportJob();
$requestBody->setOdataType('#microsoft.graph.deviceManagementExportJob');
$requestBody->setReportName('Report Name value');
$requestBody->setFilter('Filter value');
$requestBody->setSelect(['Select value', ]);
$requestBody->setFormat(new DeviceManagementReportFileFormat('pdf'));
$requestBody->setSnapshotId('Snapshot Id value');
$requestBody->setLocalizationType(new DeviceManagementExportJobLocalizationType('replaceLocalizableValues'));
$requestBody->setStatus(new DeviceManagementReportStatus('notStarted'));
$requestBody->setUrl('Url value');
$requestBody->setRequestDateTime(new \DateTime('2017-01-01T00:03:07.1589002-08:00'));
$requestBody->setExpirationDateTime(new \DateTime('2016-12-31T23:57:57.2481234-08:00'));
$result = $graphServiceClient->deviceManagement()->reports()->exportJobs()->byDeviceManagementExportJobId('deviceManagementExportJob-id')->patch($requestBody)->wait();
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation.
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph import GraphServiceClient
from msgraph.generated.models.device_management_export_job import DeviceManagementExportJob
from msgraph.generated.models.device_management_report_file_format import DeviceManagementReportFileFormat
from msgraph.generated.models.device_management_export_job_localization_type import DeviceManagementExportJobLocalizationType
from msgraph.generated.models.device_management_report_status import DeviceManagementReportStatus
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = DeviceManagementExportJob(
odata_type = "#microsoft.graph.deviceManagementExportJob",
report_name = "Report Name value",
filter = "Filter value",
select = [
"Select value",
],
format = DeviceManagementReportFileFormat.Pdf,
snapshot_id = "Snapshot Id value",
localization_type = DeviceManagementExportJobLocalizationType.ReplaceLocalizableValues,
status = DeviceManagementReportStatus.NotStarted,
url = "Url value",
request_date_time = "2017-01-01T00:03:07.1589002-08:00",
expiration_date_time = "2016-12-31T23:57:57.2481234-08:00",
)
result = await graph_client.device_management.reports.export_jobs.by_device_management_export_job_id('deviceManagementExportJob-id').patch(request_body)
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation.
Response
Here is an example of the response. Note: The response object shown here may be truncated for brevity. All of the properties will be returned from an actual call.
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 504
{
"@odata.type": "#microsoft.graph.deviceManagementExportJob",
"id": "9ddfb995-b995-9ddf-95b9-df9d95b9df9d",
"reportName": "Report Name value",
"filter": "Filter value",
"select": [
"Select value"
],
"format": "pdf",
"snapshotId": "Snapshot Id value",
"localizationType": "replaceLocalizableValues",
"status": "notStarted",
"url": "Url value",
"requestDateTime": "2017-01-01T00:03:07.1589002-08:00",
"expirationDateTime": "2016-12-31T23:57:57.2481234-08:00"
}