Get operation
Article
02/07/2024
4 contributors
Feedback
In this article
Namespace: microsoft.graph.partners.billing
Note
This API is available for Cloud Solution Provider (CSP) partners only to access their billed and unbilled reconciliation data for a tenant. To learn more about the CSP program, see Microsoft Cloud Solution Provider .
Read the properties and relationships of an operation 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
Least privileged permissions
Higher privileged permissions
Delegated (work or school account)
PartnerBilling.Read.All
Not available.
Delegated (personal Microsoft account)
Not supported.
Not supported.
Application
PartnerBilling.Read.All
Not available.
HTTP request
GET /reports/partners/billing/operations/{id}
Optional query parameters
This method doesn't support any OData query parameters to help customize the response. For general information, see OData query parameters .
Name
Description
Authorization
Bearer {token}. Required.
Request body
Don't supply a request body for this method.
Response
If an operation completes successfully, this method returns a 200 OK
response code and a microsoft.graph.partners.billing.exportSuccessOperation object in the response body. The resourceLocation navigation property in the response body represents the microsoft.graph.partners.billing.manifest resource for the operation.
If an operation fails, this method returns a 200 OK
response code and a microsoft.graph.partners.billing.failedOperation object in the response body.
If an operation is still running, this method returns a 200 OK
response code and a microsoft.graph.partners.billing.runningOperation object in the response body.
Examples
Example 1: Get operation succeeded
Request
The following example shows a request that returns a microsoft.graph.partners.billing.exportSuccessOperation object.
GET https://graph.microsoft.com/v1.0/reports/partners/billing/operations/6fe687d7-1e0f-4bd6-9091-4672691f64bc
// Code snippets are only available for the latest version. Current version is 5.x
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Reports.Partners.Billing.Operations["{operation-id}"].GetAsync();
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation .
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-sdk-go"
//other-imports
)
graphClient := msgraphsdk.NewGraphServiceClientWithCredentials(cred, scopes)
operations, err := graphClient.Reports().Partners().Billing().Operations().ByOperationId("operation-id").Get(context.Background(), 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);
com.microsoft.graph.models.partners.billing.Operation result = graphClient.reports().partners().billing().operations().byOperationId("{operation-id}").get();
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);
let operation = await client.api('/reports/partners/billing/operations/6fe687d7-1e0f-4bd6-9091-4672691f64bc')
.get();
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;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$result = $graphServiceClient->reports()->partners()->billing()->operations()->byOperationId('operation-id')->get()->wait();
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation .
from msgraph import GraphServiceClient
graph_client = GraphServiceClient(credentials, scopes)
result = await graph_client.reports.partners.billing.operations.by_operation_id('operation-id').get()
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation .
Response
The following example shows the response for an operation that completed successfully.
Note: The response object shown here might be shortened for readability.
HTTP/1.1 200 OK
Content-Type: application/json
{
"@odata.type": "#microsoft.graph.partners.billing.exportSuccessOperation",
"id": "6fe687d7-1e0f-4bd6-9091-4672691f64bc",
"status": "succeeded",
"createdDateTime": "2023-03-09T08:12:53",
"lastActionDateTime": "2023-03-09T08:37:48.5046691Z",
"resourceLocation@odata.navigationLink": "https://graph.microsoft.com/v1.0/reports/partners/billing/manifests/8fe347d7-1e0f-4bd6-9091-4672691f32db"
}
Example 2: Get operation failed
Request
The following example shows a request that returns a microsoft.graph.partners.billing.failedOperation object.
GET https://graph.microsoft.com/v1.0/reports/partners/billing/operations/6fe687d7-1e0f-4bd6-9091-4672691f64bc
// Code snippets are only available for the latest version. Current version is 5.x
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Reports.Partners.Billing.Operations["{operation-id}"].GetAsync();
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation .
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-sdk-go"
//other-imports
)
graphClient := msgraphsdk.NewGraphServiceClientWithCredentials(cred, scopes)
operations, err := graphClient.Reports().Partners().Billing().Operations().ByOperationId("operation-id").Get(context.Background(), 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);
com.microsoft.graph.models.partners.billing.Operation result = graphClient.reports().partners().billing().operations().byOperationId("{operation-id}").get();
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);
let operation = await client.api('/reports/partners/billing/operations/6fe687d7-1e0f-4bd6-9091-4672691f64bc')
.get();
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;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$result = $graphServiceClient->reports()->partners()->billing()->operations()->byOperationId('operation-id')->get()->wait();
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation .
from msgraph import GraphServiceClient
graph_client = GraphServiceClient(credentials, scopes)
result = await graph_client.reports.partners.billing.operations.by_operation_id('operation-id').get()
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation .
Response
The following example shows the response for an operation that failed.
Note: The response object shown here might be shortened for readability.
HTTP/1.1 200 OK
Content-Type: application/json
{
"@odata.type": "#microsoft.graph.partners.billing.failedOperation",
"id": "6fe687d7-1e0f-4bd6-9091-4672691f64bc",
"status": "failed",
"createdDateTime": "2023-03-09T08:12:53",
"lastActionDateTime": "2023-03-09T08:37:48.5046691Z",
"error": {
"message": "No data available",
"code": "5000"
}
}
Example 3: Get operation is still running
Request
The following example shows a request that returns a microsoft.graph.partners.billing.runningOperation object.
GET https://graph.microsoft.com/v1.0/reports/partners/billing/operations/6fe687d7-1e0f-4bd6-9091-4672691f64bc
// Code snippets are only available for the latest version. Current version is 5.x
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Reports.Partners.Billing.Operations["{operation-id}"].GetAsync();
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation .
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-sdk-go"
//other-imports
)
graphClient := msgraphsdk.NewGraphServiceClientWithCredentials(cred, scopes)
operations, err := graphClient.Reports().Partners().Billing().Operations().ByOperationId("operation-id").Get(context.Background(), 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);
com.microsoft.graph.models.partners.billing.Operation result = graphClient.reports().partners().billing().operations().byOperationId("{operation-id}").get();
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);
let operation = await client.api('/reports/partners/billing/operations/6fe687d7-1e0f-4bd6-9091-4672691f64bc')
.get();
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;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$result = $graphServiceClient->reports()->partners()->billing()->operations()->byOperationId('operation-id')->get()->wait();
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation .
from msgraph import GraphServiceClient
graph_client = GraphServiceClient(credentials, scopes)
result = await graph_client.reports.partners.billing.operations.by_operation_id('operation-id').get()
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation .
Response
The following example shows the response for an operation that is still running.
Note: The response object shown here might be shortened for readability.
HTTP/1.1 200 OK
Content-Type: application/json
{
"@odata.type": "#microsoft.graph.partners.billing.runningOperation",
"id": "6fe687d7-1e0f-4bd6-9091-4672691f64bc",
"status": "running",
"createdDateTime": "2023-03-09T08:12:53",
"lastActionDateTime": "2023-03-09T08:37:48.5046691Z"
}