命名空间:microsoft.graph
重要
Microsoft Graph /beta 版本下的 API 可能会发生更改。 不支持在生产应用程序中使用这些 API。 若要确定 API 是否在 v1.0 中可用,请使用 版本 选择器。
在Viva Goals组织中创建新的 goalsExportJob 对象。
此 API 可用于以下国家级云部署。
| 全局服务 |
美国政府 L4 |
美国政府 L5 (DOD) |
由世纪互联运营的中国 |
| ✅ |
❌ |
❌ |
❌ |
权限
为此 API 选择标记为最低特权的权限。
只有在应用需要它时,才使用更高的特权权限。 有关委派权限和应用程序权限的详细信息,请参阅权限类型。 要了解有关这些权限的详细信息,请参阅 权限参考。
| 权限类型 |
最低特权权限 |
更高特权权限 |
| 委派(工作或学校帐户) |
Goals-Export.ReadWrite.All |
不可用。 |
| 委派(个人 Microsoft 帐户) |
不支持。 |
不支持。 |
| 应用程序 |
不支持。 |
不支持。 |
HTTP 请求
POST /employeeExperience/goals/exportJobs
| 名称 |
说明 |
| Authorization |
持有者 {token}。 必填。 详细了解 身份验证和授权。 |
| Content-type |
application/json. 必需。 |
请求正文
在请求正文中,提供 goalsExportJob 对象的 JSON 表示形式。
创建 goalsExportJob 对象时,可以指定以下属性。
| 属性 |
类型 |
说明 |
| goalsOrganizationId |
String |
Viva Goals组织的唯一标识符。 |
| explorerViewId |
String |
要导出的资源管理器视图的唯一标识符。 |
可以从资源管理器视图的 URL 获取 goalsOrganizationId 和 explorerViewId 值。
https://goals.microsoft.com/org_uuid/94a356ab-53d5-40e7-8a85-053d6d3b9eb3/objective-explorer?viewId=e5e7a3c1-8cdf-409d-9ce9-ff730d65d95e
-
org_uuid在此示例中94a356ab-53d5-40e7-8a85-053d6d3b9eb3,URL 中的 表示 goalsOrganizationId。
-
viewId在此示例中e5e7a3c1-8cdf-409d-9ce9-ff730d65d95e,URL 中的 表示 explorerViewId。
响应
如果成功,此方法在响应正文中返回响应 201 Created 代码和 goalsExportJob 对象。
尝试创建与目标相同值的 goalsExportJob 对象时,此方法也会返回 409 Conflict , (goalsOrganizationId 和 explorerViewId) 为待完成的现有 goalsExportJob 对象。
挂起的作业完成后,可以创建新的 goalsExportJob 对象。
| 名称 |
说明 |
| 位置 |
用于调用的 URL,检查作的状态。 必填。 |
示例
示例 1:状态为 notStarted
请求
以下示例显示了一个请求。
POST https://graph.microsoft.com/beta/employeeExperience/goals/exportJobs
Content-Type: application/json
{
"goalsOrganizationId": "String",
"explorerViewId": "String"
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.Models;
var requestBody = new GoalsExportJob
{
GoalsOrganizationId = "String",
ExplorerViewId = "String",
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.EmployeeExperience.Goals.ExportJobs.PostAsync(requestBody);
// Code snippets are only available for the latest major version. Current major version is $v0.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-beta-sdk-go"
graphmodels "github.com/microsoftgraph/msgraph-beta-sdk-go/models"
//other-imports
)
requestBody := graphmodels.NewGoalsExportJob()
goalsOrganizationId := "String"
requestBody.SetGoalsOrganizationId(&goalsOrganizationId)
explorerViewId := "String"
requestBody.SetExplorerViewId(&explorerViewId)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
exportJobs, err := graphClient.EmployeeExperience().Goals().ExportJobs().Post(context.Background(), requestBody, nil)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
GoalsExportJob goalsExportJob = new GoalsExportJob();
goalsExportJob.setGoalsOrganizationId("String");
goalsExportJob.setExplorerViewId("String");
GoalsExportJob result = graphClient.employeeExperience().goals().exportJobs().post(goalsExportJob);
const options = {
authProvider,
};
const client = Client.init(options);
const goalsExportJob = {
goalsOrganizationId: 'String',
explorerViewId: 'String'
};
await client.api('/employeeExperience/goals/exportJobs')
.version('beta')
.post(goalsExportJob);
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Models\GoalsExportJob;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new GoalsExportJob();
$requestBody->setGoalsOrganizationId('String');
$requestBody->setExplorerViewId('String');
$result = $graphServiceClient->employeeExperience()->goals()->exportJobs()->post($requestBody)->wait();
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
from msgraph_beta.generated.models.goals_export_job import GoalsExportJob
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = GoalsExportJob(
goals_organization_id = "String",
explorer_view_id = "String",
)
result = await graph_client.employee_experience.goals.export_jobs.post(request_body)
响应
以下示例显示了相应的响应。
注意:为了提高可读性,可能缩短了此处显示的响应对象。
HTTP/1.1 201 Created
Content-Type: application/json
Location: "https://graph.microsoft.com/beta/employeeexperience/goals/exportJobs/j!uJJZyGd87hGFgvZV8bl-GlCBmj39kL1Cl3clung9SgU"
{
"@odata.type": "#microsoft.graph.goalsExportJob",
"id": "9eb0bfa0-eaa1-b225-1f83-54ae3e711753",
"createdDateTime": "String (timestamp)",
"status": "String"
}
示例 2:状态为 conflicting
请求
以下示例显示了一个请求。
POST https://graph.microsoft.com/beta/employeeExperience/goals/exportJobs
Content-Type: application/json
{
"goalsOrganizationId": "String",
"explorerViewId": "String"
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.Models;
var requestBody = new GoalsExportJob
{
GoalsOrganizationId = "String",
ExplorerViewId = "String",
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.EmployeeExperience.Goals.ExportJobs.PostAsync(requestBody);
// Code snippets are only available for the latest major version. Current major version is $v0.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-beta-sdk-go"
graphmodels "github.com/microsoftgraph/msgraph-beta-sdk-go/models"
//other-imports
)
requestBody := graphmodels.NewGoalsExportJob()
goalsOrganizationId := "String"
requestBody.SetGoalsOrganizationId(&goalsOrganizationId)
explorerViewId := "String"
requestBody.SetExplorerViewId(&explorerViewId)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
exportJobs, err := graphClient.EmployeeExperience().Goals().ExportJobs().Post(context.Background(), requestBody, nil)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
GoalsExportJob goalsExportJob = new GoalsExportJob();
goalsExportJob.setGoalsOrganizationId("String");
goalsExportJob.setExplorerViewId("String");
GoalsExportJob result = graphClient.employeeExperience().goals().exportJobs().post(goalsExportJob);
const options = {
authProvider,
};
const client = Client.init(options);
const goalsExportJob = {
goalsOrganizationId: 'String',
explorerViewId: 'String'
};
await client.api('/employeeExperience/goals/exportJobs')
.version('beta')
.post(goalsExportJob);
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Models\GoalsExportJob;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new GoalsExportJob();
$requestBody->setGoalsOrganizationId('String');
$requestBody->setExplorerViewId('String');
$result = $graphServiceClient->employeeExperience()->goals()->exportJobs()->post($requestBody)->wait();
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
from msgraph_beta.generated.models.goals_export_job import GoalsExportJob
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = GoalsExportJob(
goals_organization_id = "String",
explorer_view_id = "String",
)
result = await graph_client.employee_experience.goals.export_jobs.post(request_body)
响应
以下示例显示了相应的响应。
注意:为了提高可读性,可能缩短了此处显示的响应对象。
HTTP/1.1 409 Conflict
Content-type: application/json
Location: "https://graph.microsoft.com/beta/employeeexperience/goals/exportJobs/j!uJJZyGd87hGFgvZV8bl-GlCBmj39kL1Cl3clung9SgU"
{
"error":
{
"code": "notAllowed",
"message": "Another export job is still active or waiting to be executed",
"target": "j!uJJZyGd87hGFgvZV8bl-GlCBmj39kL1Cl3clung9SgU",
"innererror":
{
"code": "exportJobAlreadyExists",
"date": "String (timestamp)",
"request-id": "String",
"client-request-id": "String"
}
}
}
示例 3:指定的 goalsOrganizationId 不存在
请求
以下示例显示了一个请求。
POST https://graph.microsoft.com/beta/employeeExperience/goals/exportJobs
Content-Type: application/json
{
"goalsOrganizationId": "String",
"explorerViewId": "String"
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.Models;
var requestBody = new GoalsExportJob
{
GoalsOrganizationId = "String",
ExplorerViewId = "String",
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.EmployeeExperience.Goals.ExportJobs.PostAsync(requestBody);
// Code snippets are only available for the latest major version. Current major version is $v0.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-beta-sdk-go"
graphmodels "github.com/microsoftgraph/msgraph-beta-sdk-go/models"
//other-imports
)
requestBody := graphmodels.NewGoalsExportJob()
goalsOrganizationId := "String"
requestBody.SetGoalsOrganizationId(&goalsOrganizationId)
explorerViewId := "String"
requestBody.SetExplorerViewId(&explorerViewId)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
exportJobs, err := graphClient.EmployeeExperience().Goals().ExportJobs().Post(context.Background(), requestBody, nil)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
GoalsExportJob goalsExportJob = new GoalsExportJob();
goalsExportJob.setGoalsOrganizationId("String");
goalsExportJob.setExplorerViewId("String");
GoalsExportJob result = graphClient.employeeExperience().goals().exportJobs().post(goalsExportJob);
const options = {
authProvider,
};
const client = Client.init(options);
const goalsExportJob = {
goalsOrganizationId: 'String',
explorerViewId: 'String'
};
await client.api('/employeeExperience/goals/exportJobs')
.version('beta')
.post(goalsExportJob);
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Models\GoalsExportJob;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new GoalsExportJob();
$requestBody->setGoalsOrganizationId('String');
$requestBody->setExplorerViewId('String');
$result = $graphServiceClient->employeeExperience()->goals()->exportJobs()->post($requestBody)->wait();
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
from msgraph_beta.generated.models.goals_export_job import GoalsExportJob
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = GoalsExportJob(
goals_organization_id = "String",
explorer_view_id = "String",
)
result = await graph_client.employee_experience.goals.export_jobs.post(request_body)
响应
以下示例显示了相应的响应。
注意:为了提高可读性,可能缩短了此处显示的响应对象。
HTTP/1.1 404 Not Found
Content-type: application/json
{
"error": {
"code": "notFound",
"message": "Goals organization not found",
"innerError": {
"code": "goalsOrganizationIdNotFound",
"date": "String (timestamp)",
"request-id": "String",
"client-request-id": "String"
}
}
}
示例 4:传递无效 goalsOrganizationId
请求
以下示例显示了一个请求。
POST https://graph.microsoft.com/beta/employeeExperience/goals/exportJobs
Content-Type: application/json
{
"goalsOrganizationId": "String",
"explorerViewId": "String"
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.Models;
var requestBody = new GoalsExportJob
{
GoalsOrganizationId = "String",
ExplorerViewId = "String",
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.EmployeeExperience.Goals.ExportJobs.PostAsync(requestBody);
// Code snippets are only available for the latest major version. Current major version is $v0.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-beta-sdk-go"
graphmodels "github.com/microsoftgraph/msgraph-beta-sdk-go/models"
//other-imports
)
requestBody := graphmodels.NewGoalsExportJob()
goalsOrganizationId := "String"
requestBody.SetGoalsOrganizationId(&goalsOrganizationId)
explorerViewId := "String"
requestBody.SetExplorerViewId(&explorerViewId)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
exportJobs, err := graphClient.EmployeeExperience().Goals().ExportJobs().Post(context.Background(), requestBody, nil)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
GoalsExportJob goalsExportJob = new GoalsExportJob();
goalsExportJob.setGoalsOrganizationId("String");
goalsExportJob.setExplorerViewId("String");
GoalsExportJob result = graphClient.employeeExperience().goals().exportJobs().post(goalsExportJob);
const options = {
authProvider,
};
const client = Client.init(options);
const goalsExportJob = {
goalsOrganizationId: 'String',
explorerViewId: 'String'
};
await client.api('/employeeExperience/goals/exportJobs')
.version('beta')
.post(goalsExportJob);
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Models\GoalsExportJob;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new GoalsExportJob();
$requestBody->setGoalsOrganizationId('String');
$requestBody->setExplorerViewId('String');
$result = $graphServiceClient->employeeExperience()->goals()->exportJobs()->post($requestBody)->wait();
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
from msgraph_beta.generated.models.goals_export_job import GoalsExportJob
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = GoalsExportJob(
goals_organization_id = "String",
explorer_view_id = "String",
)
result = await graph_client.employee_experience.goals.export_jobs.post(request_body)
响应
以下示例显示了相应的响应。
注意:为了提高可读性,可能缩短了此处显示的响应对象。
HTTP/1.1 400 Bad Request
Content-type: application/json
{
"error": {
"code": "badRequest",
"message": "'GoalsOrganizationId' must be specified in 'Export Job', and it should be a valid GUID.",
"innerError": {
"code": "invalidGoalsOrganizationId",
"date": "String (timestamp)",
"request-id": "String",
"client-request-id": "String"
}
}
}