获取工作流
命名空间:microsoft.graph.identityGovernance
读取 工作流 对象的属性和关系。
此 API 可用于以下国家级云部署。
全局服务 | 美国政府 L4 | 美国政府 L5 (DOD) | 由世纪互联运营的中国 |
---|---|---|---|
✅ | ✅ | ✅ | ❌ |
权限
为此 API 选择标记为最低特权的权限。 只有在应用需要它时,才使用更高的特权权限。 有关委派权限和应用程序权限的详细信息,请参阅权限类型。 要了解有关这些权限的详细信息,请参阅 权限参考。
权限类型 | 最低特权权限 | 更高特权权限 |
---|---|---|
委派(工作或学校帐户) | LifecycleWorkflows.Read.Workflows | LifecycleWorkflows.Read.All、LifecycleWorkflows.ReadWrite.All、LifecycleWorkflows.ReadWrite.Workflows |
委派(个人 Microsoft 帐户) | 不支持。 | 不支持。 |
应用程序 | LifecycleWorkflows.Read.Workflows | LifecycleWorkflows.Read.All、LifecycleWorkflows.ReadWrite.All、LifecycleWorkflows.ReadWrite.Workflows |
重要
在具有工作或学校帐户的委托方案中,必须为登录用户分配受支持的Microsoft Entra角色或具有支持的角色权限的自定义角色。 全局读取者和生命周期工作流管理员是此操作支持的最低特权角色。
HTTP 请求
GET /identityGovernance/lifecycleWorkflows/workflows/{workflowId}
可选的查询参数
此方法支持 $select
和 $expand
OData 查询参数,以帮助自定义响应。
默认情况下,任务关系会展开,受 $expand
createdBy 和 lastModifiedBy 关系的支持。 若要了解一般信息,请参阅 OData 查询参数。
请求标头
名称 | 说明 |
---|---|
Authorization | 持有者 {token}。 必填。 详细了解 身份验证和授权。 |
请求正文
请勿提供此方法的请求正文。
响应
如果成功,此方法在 200 OK
响应正文中返回响应代码和 microsoft.graph.identityGovernance.workflow 对象。
示例
示例 1:检索工作流的详细信息
请求
以下示例显示了一个请求。
GET https://graph.microsoft.com/v1.0/identityGovernance/lifecycleWorkflows/workflows/156ce798-1eb6-4e0a-8515-e79f54d04390
响应
以下示例显示了相应的响应。
HTTP/1.1 200 OK
Content-Type: application/json
{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#identityGovernance/lifecycleWorkflows/workflows/$entity",
"category": "joiner",
"description": "Configure new hire tasks for onboarding employees on their first day",
"displayName": "Onboard new hire employee",
"lastModifiedDateTime": "2022-08-24T15:39:17.6496744Z",
"createdDateTime": "2022-08-24T15:39:17.6496704Z",
"deletedDateTime": null,
"id": "156ce798-1eb6-4e0a-8515-e79f54d04390",
"isEnabled": true,
"isSchedulingEnabled": false,
"nextScheduleRunDateTime": null,
"version": 1,
"executionConditions": {
"@odata.type": "#microsoft.graph.identityGovernance.triggerAndScopeBasedConditions",
"scope": {
"@odata.type": "#microsoft.graph.identityGovernance.ruleBasedSubjectSet",
"rule": "(department eq 'Marketing')"
},
"trigger": {
"@odata.type": "#microsoft.graph.identityGovernance.timeBasedAttributeTrigger",
"timeBasedAttribute": "employeeHireDate",
"offsetInDays": 0
}
},
"lastModifiedBy": {
"id": "a698128f-b34f-44db-a9f9-7661c7aba8d8"
},
"tasks@odata.context": "https://graph.microsoft.com/v1.0/$metadata#identityGovernance/lifecycleWorkflows/workflows('156ce798-1eb6-4e0a-8515-e79f54d04390')/tasks",
"tasks": [
{
"category": "joiner,leaver",
"continueOnError": false,
"description": "Enable user account in the directory",
"displayName": "Enable User Account",
"executionSequence": 1,
"id": "4469d2ee-0626-4aa6-a792-84afcb9f3759",
"isEnabled": true,
"taskDefinitionId": "6fc52c9d-398b-4305-9763-15f42c1676fc",
"arguments": []
},
{
"category": "joiner",
"continueOnError": false,
"description": "Send welcome email to new hire",
"displayName": "Send Welcome Email",
"executionSequence": 2,
"id": "e93e4d5d-1bcd-4175-b8a1-81729e3b4df9",
"isEnabled": true,
"taskDefinitionId": "70b29d51-b59a-4773-9280-8841dfd3f2ea",
"arguments": []
},
{
"category": "joiner,leaver",
"continueOnError": false,
"description": "Add user to selected groups",
"displayName": "Add User To Groups",
"executionSequence": 3,
"id": "072a6872-6052-4d4a-93f0-a0ff3f1dec19",
"isEnabled": true,
"taskDefinitionId": "22085229-5809-45e8-97fd-270d28d66910",
"arguments": [
{
"name": "groupID",
"value": "e5659cb0-bcbb-4a9f-9092-90f72bd19028"
}
]
}
],
"createdBy": {
"id": "a698128f-b34f-44db-a9f9-7661c7aba8d8"
}
}
示例 2:检索工作流的特定属性
请求
GET https://graph.microsoft.com/v1.0/identityGovernance/lifecycleWorkflows/workflows/c0548e6c-8849-46e8-be14-8b6d2b04957e?$select=id,displayName,executionConditions,category
响应
HTTP/1.1 200 OK
Content-Type: application/json
{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#identityGovernance/lifecycleWorkflows/workflows(id,displayName,executionConditions,category)/$entity",
"category": "leaver",
"displayName": "Pre-Offboarding employees in the R&D department",
"id": "c0548e6c-8849-46e8-be14-8b6d2b04957e",
"executionConditions": {
"@odata.type": "#microsoft.graph.identityGovernance.triggerAndScopeBasedConditions",
"scope": {
"@odata.type": "#microsoft.graph.identityGovernance.ruleBasedSubjectSet",
"rule": "(department eq 'R&D')"
},
"trigger": {
"@odata.type": "#microsoft.graph.identityGovernance.timeBasedAttributeTrigger",
"timeBasedAttribute": "employeeLeaveDateTime",
"offsetInDays": -7
}
}
}