Espace de noms : microsoft.graph.identityGovernance
Activez un workflow de cycle de vie pour un sujet spécifié et attendez de façon synchrone la fin de l’exécution. Cette action retourne un awaitedWorkflowProcessingResult avec le résultat de l’exécution. Utilisez cette action lorsque vous avez besoin d’une confirmation immédiate de l’achèvement du flux de travail, par exemple lors de l’approvisionnement d’un sujet non-utilisateur.
Cette API est disponible dans les déploiements cloud nationaux suivants.
| Service global |
Gouvernement américain L4 |
Gouvernement américain L5 (DOD) |
Chine exploitée par 21Vianet |
| ✅ |
✅ |
✅ |
✅ |
Autorisations
Choisissez l’autorisation ou les autorisations marquées comme étant les moins privilégiées pour cette API. Utilisez une ou plusieurs autorisations privilégiées uniquement si votre application en a besoin. Pour plus d’informations sur les autorisations déléguées et d’application, voir Types d’autorisations. Pour en savoir plus sur ces autorisations, consultez la référence des autorisations.
| Type d’autorisation |
Autorisations les moins privilégiées |
Autorisations à privilèges plus élevés |
| Déléguée (compte professionnel ou scolaire) |
LifecycleWorkflows-Workflow.Activate |
LifecycleWorkflows-Workflow.ReadWrite.All, LifecycleWorkflows.ReadWrite.All |
| Déléguée (compte Microsoft personnel) |
Non prise en charge. |
Non prise en charge. |
| Application |
LifecycleWorkflows-Workflow.Activate |
LifecycleWorkflows-Workflow.ReadWrite.All, LifecycleWorkflows.ReadWrite.All |
Requête HTTP
POST /identityGovernance/lifecycleWorkflows/workflows/{workflowId}/activateAndWait
Corps de la demande
Dans le corps de la demande, fournissez une représentation JSON des paramètres.
Le tableau suivant répertorie les paramètres qui sont requis lorsque vous appelez cette action.
| Paramètre |
Type |
Description |
| sujet |
microsoft.graph.identityGovernance.workflowSubject |
Objet pour lequel activer le flux de travail. Doit inclure la @odata.type propriété pour spécifier le type dérivé (par exemple, #microsoft.graph.identityGovernance.provisioningObjectWorkflowSubject). Obligatoire. |
Réponse
En cas de succès, cette action retourne un 200 OK code de réponse et un awaitedWorkflowProcessingResult dans le corps de la réponse.
Exemples
Demande
L’exemple suivant illustre une demande.
POST https://graph.microsoft.com/v1.0/identityGovernance/lifecycleWorkflows/workflows/14879a93-6b91-4153-b7e6-5df4a7b7c5c8/activateAndWait
Content-Type: application/json
{
"subject": {
"@odata.type": "#microsoft.graph.identityGovernance.provisioningObjectWorkflowSubject",
"id": "b74f0fae-b1f3-4c96-9bf0-d4d8a8e37cbe",
"attributeSetEntries": [
{
"name": "department",
"value": "Engineering"
},
{
"name": "jobTitle",
"value": "Software Engineer"
}
]
}
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.IdentityGovernance.LifecycleWorkflows.Workflows.Item.MicrosoftGraphIdentityGovernanceActivateAndWait;
using Microsoft.Graph.Models.IdentityGovernance;
var requestBody = new ActivateAndWaitPostRequestBody
{
Subject = new ProvisioningObjectWorkflowSubject
{
OdataType = "#microsoft.graph.identityGovernance.provisioningObjectWorkflowSubject",
Id = "b74f0fae-b1f3-4c96-9bf0-d4d8a8e37cbe",
AttributeSetEntries = new List<AttributeSetEntry>
{
new AttributeSetEntry
{
Name = "department",
Value = "Engineering",
},
new AttributeSetEntry
{
Name = "jobTitle",
Value = "Software Engineer",
},
},
},
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.IdentityGovernance.LifecycleWorkflows.Workflows["{workflow-id}"].MicrosoftGraphIdentityGovernanceActivateAndWait.PostAsync(requestBody);
Pour plus d’informations sur la façon d'ajouter le Kit de développement logiciel (SDK) à votre projet et créer une instance authProvider, consultez la documentation du Kit de développement logiciel (SDK).
// Code snippets are only available for the latest major version. Current major version is $v1.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-sdk-go"
graphidentitygovernance "github.com/microsoftgraph/msgraph-sdk-go/identitygovernance"
graphmodelsidentitygovernance "github.com/microsoftgraph/msgraph-sdk-go/models/identitygovernance"
//other-imports
)
requestBody := graphidentitygovernance.NewActivateAndWaitPostRequestBody()
subject := graphmodelsidentitygovernance.NewProvisioningObjectWorkflowSubject()
id := "b74f0fae-b1f3-4c96-9bf0-d4d8a8e37cbe"
subject.SetId(&id)
attributeSetEntry := graphmodelsidentitygovernance.NewAttributeSetEntry()
name := "department"
attributeSetEntry.SetName(&name)
value := "Engineering"
attributeSetEntry.SetValue(&value)
attributeSetEntry1 := graphmodelsidentitygovernance.NewAttributeSetEntry()
name := "jobTitle"
attributeSetEntry1.SetName(&name)
value := "Software Engineer"
attributeSetEntry1.SetValue(&value)
attributeSetEntries := []graphmodelsidentitygovernance.AttributeSetEntryable {
attributeSetEntry,
attributeSetEntry1,
}
subject.SetAttributeSetEntries(attributeSetEntries)
requestBody.SetSubject(subject)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
microsoftGraphIdentityGovernanceActivateAndWait, err := graphClient.IdentityGovernance().LifecycleWorkflows().Workflows().ByWorkflowId("workflow-id").MicrosoftGraphIdentityGovernanceActivateAndWait().Post(context.Background(), requestBody, nil)
Pour plus d’informations sur la façon d'ajouter le Kit de développement logiciel (SDK) à votre projet et créer une instance authProvider, consultez la documentation du Kit de développement logiciel (SDK).
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
com.microsoft.graph.identitygovernance.lifecycleworkflows.workflows.item.microsoftgraphidentitygovernanceactivateandwait.ActivateAndWaitPostRequestBody activateAndWaitPostRequestBody = new com.microsoft.graph.identitygovernance.lifecycleworkflows.workflows.item.microsoftgraphidentitygovernanceactivateandwait.ActivateAndWaitPostRequestBody();
com.microsoft.graph.models.identitygovernance.ProvisioningObjectWorkflowSubject subject = new com.microsoft.graph.models.identitygovernance.ProvisioningObjectWorkflowSubject();
subject.setOdataType("#microsoft.graph.identityGovernance.provisioningObjectWorkflowSubject");
subject.setId("b74f0fae-b1f3-4c96-9bf0-d4d8a8e37cbe");
LinkedList<com.microsoft.graph.models.identitygovernance.AttributeSetEntry> attributeSetEntries = new LinkedList<com.microsoft.graph.models.identitygovernance.AttributeSetEntry>();
com.microsoft.graph.models.identitygovernance.AttributeSetEntry attributeSetEntry = new com.microsoft.graph.models.identitygovernance.AttributeSetEntry();
attributeSetEntry.setName("department");
attributeSetEntry.setValue("Engineering");
attributeSetEntries.add(attributeSetEntry);
com.microsoft.graph.models.identitygovernance.AttributeSetEntry attributeSetEntry1 = new com.microsoft.graph.models.identitygovernance.AttributeSetEntry();
attributeSetEntry1.setName("jobTitle");
attributeSetEntry1.setValue("Software Engineer");
attributeSetEntries.add(attributeSetEntry1);
subject.setAttributeSetEntries(attributeSetEntries);
activateAndWaitPostRequestBody.setSubject(subject);
var result = graphClient.identityGovernance().lifecycleWorkflows().workflows().byWorkflowId("{workflow-id}").microsoftGraphIdentityGovernanceActivateAndWait().post(activateAndWaitPostRequestBody);
Pour plus d’informations sur la façon d'ajouter le Kit de développement logiciel (SDK) à votre projet et créer une instance authProvider, consultez la documentation du Kit de développement logiciel (SDK).
const options = {
authProvider,
};
const client = Client.init(options);
const awaitedWorkflowProcessingResult = {
subject: {
'@odata.type': '#microsoft.graph.identityGovernance.provisioningObjectWorkflowSubject',
id: 'b74f0fae-b1f3-4c96-9bf0-d4d8a8e37cbe',
attributeSetEntries: [
{
name: 'department',
value: 'Engineering'
},
{
name: 'jobTitle',
value: 'Software Engineer'
}
]
}
};
await client.api('/identityGovernance/lifecycleWorkflows/workflows/14879a93-6b91-4153-b7e6-5df4a7b7c5c8/activateAndWait')
.post(awaitedWorkflowProcessingResult);
Pour plus d’informations sur la façon d'ajouter le Kit de développement logiciel (SDK) à votre projet et créer une instance authProvider, consultez la documentation du Kit de développement logiciel (SDK).
<?php
use Microsoft\Graph\GraphServiceClient;
use Microsoft\Graph\Generated\IdentityGovernance\LifecycleWorkflows\Workflows\Item\MicrosoftGraphIdentityGovernanceActivateAndWait\ActivateAndWaitPostRequestBody;
use Microsoft\Graph\Generated\Models\IdentityGovernance\ProvisioningObjectWorkflowSubject;
use Microsoft\Graph\Generated\Models\IdentityGovernance\AttributeSetEntry;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new ActivateAndWaitPostRequestBody();
$subject = new ProvisioningObjectWorkflowSubject();
$subject->setOdataType('#microsoft.graph.identityGovernance.provisioningObjectWorkflowSubject');
$subject->setId('b74f0fae-b1f3-4c96-9bf0-d4d8a8e37cbe');
$attributeSetEntriesAttributeSetEntry1 = new AttributeSetEntry();
$attributeSetEntriesAttributeSetEntry1->setName('department');
$attributeSetEntriesAttributeSetEntry1->setValue('Engineering');
$attributeSetEntriesArray []= $attributeSetEntriesAttributeSetEntry1;
$attributeSetEntriesAttributeSetEntry2 = new AttributeSetEntry();
$attributeSetEntriesAttributeSetEntry2->setName('jobTitle');
$attributeSetEntriesAttributeSetEntry2->setValue('Software Engineer');
$attributeSetEntriesArray []= $attributeSetEntriesAttributeSetEntry2;
$subject->setAttributeSetEntries($attributeSetEntriesArray);
$requestBody->setSubject($subject);
$result = $graphServiceClient->identityGovernance()->lifecycleWorkflows()->workflows()->byWorkflowId('workflow-id')->microsoftGraphIdentityGovernanceActivateAndWait()->post($requestBody)->wait();
Pour plus d’informations sur la façon d'ajouter le Kit de développement logiciel (SDK) à votre projet et créer une instance authProvider, consultez la documentation du Kit de développement logiciel (SDK).
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph import GraphServiceClient
from msgraph.generated.identitygovernance.lifecycleworkflows.workflows.item.microsoft_graph_identity_governance_activate_and_wait.activate_and_wait_post_request_body import ActivateAndWaitPostRequestBody
from msgraph.generated.models.identity_governance.provisioning_object_workflow_subject import ProvisioningObjectWorkflowSubject
from msgraph.generated.models.identity_governance.attribute_set_entry import AttributeSetEntry
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = ActivateAndWaitPostRequestBody(
subject = ProvisioningObjectWorkflowSubject(
odata_type = "#microsoft.graph.identityGovernance.provisioningObjectWorkflowSubject",
id = "b74f0fae-b1f3-4c96-9bf0-d4d8a8e37cbe",
attribute_set_entries = [
AttributeSetEntry(
name = "department",
value = "Engineering",
),
AttributeSetEntry(
name = "jobTitle",
value = "Software Engineer",
),
],
),
)
result = await graph_client.identity_governance.lifecycle_workflows.workflows.by_workflow_id('workflow-id').microsoft_graph_identity_governance_activate_and_wait.post(request_body)
Pour plus d’informations sur la façon d'ajouter le Kit de développement logiciel (SDK) à votre projet et créer une instance authProvider, consultez la documentation du Kit de développement logiciel (SDK).
Réponse
L’exemple suivant illustre la réponse.
Remarque
L’objet de réponse affiché ci-après peut être raccourci pour plus de lisibilité.
HTTP/1.1 200 OK
Content-Type: application/json
{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#microsoft.graph.identityGovernance.awaitedWorkflowProcessingResult",
"processingStatus": "completed",
"statusReasons": [],
"subject": {
"@odata.type": "#microsoft.graph.identityGovernance.provisioningObjectWorkflowSubject",
"id": "b74f0fae-b1f3-4c96-9bf0-d4d8a8e37cbe",
"attributeSetEntries": [
{
"name": "department",
"value": "Engineering"
},
{
"name": "jobTitle",
"value": "Software Engineer"
}
]
}
}