PATCH https://graph.microsoft.com/v1.0/deviceManagement/termsAndConditions/{termsAndConditionsId}/acceptanceStatuses/{termsAndConditionsAcceptanceStatusId}
Content-type: application/json
Content-length: 264
{
"@odata.type": "#microsoft.graph.termsAndConditionsAcceptanceStatus",
"userDisplayName": "User Display Name value",
"acceptedVersion": 15,
"acceptedDateTime": "2016-12-31T23:57:43.6165506-08:00",
"userPrincipalName": "User Principal Name value"
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Models;
var requestBody = new TermsAndConditionsAcceptanceStatus
{
OdataType = "#microsoft.graph.termsAndConditionsAcceptanceStatus",
UserDisplayName = "User Display Name value",
AcceptedVersion = 15,
AcceptedDateTime = DateTimeOffset.Parse("2016-12-31T23:57:43.6165506-08:00"),
UserPrincipalName = "User Principal Name value",
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.DeviceManagement.TermsAndConditions["{termsAndConditions-id}"].AcceptanceStatuses["{termsAndConditionsAcceptanceStatus-id}"].PatchAsync(requestBody);
// 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.NewTermsAndConditionsAcceptanceStatus()
userDisplayName := "User Display Name value"
requestBody.SetUserDisplayName(&userDisplayName)
acceptedVersion := int32(15)
requestBody.SetAcceptedVersion(&acceptedVersion)
acceptedDateTime , err := time.Parse(time.RFC3339, "2016-12-31T23:57:43.6165506-08:00")
requestBody.SetAcceptedDateTime(&acceptedDateTime)
userPrincipalName := "User Principal Name value"
requestBody.SetUserPrincipalName(&userPrincipalName)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
acceptanceStatuses, err := graphClient.DeviceManagement().TermsAndConditions().ByTermsAndConditionsId("termsAndConditions-id").AcceptanceStatuses().ByTermsAndConditionsAcceptanceStatusId("termsAndConditionsAcceptanceStatus-id").Patch(context.Background(), requestBody, nil)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
TermsAndConditionsAcceptanceStatus termsAndConditionsAcceptanceStatus = new TermsAndConditionsAcceptanceStatus();
termsAndConditionsAcceptanceStatus.setOdataType("#microsoft.graph.termsAndConditionsAcceptanceStatus");
termsAndConditionsAcceptanceStatus.setUserDisplayName("User Display Name value");
termsAndConditionsAcceptanceStatus.setAcceptedVersion(15);
OffsetDateTime acceptedDateTime = OffsetDateTime.parse("2016-12-31T23:57:43.6165506-08:00");
termsAndConditionsAcceptanceStatus.setAcceptedDateTime(acceptedDateTime);
termsAndConditionsAcceptanceStatus.setUserPrincipalName("User Principal Name value");
TermsAndConditionsAcceptanceStatus result = graphClient.deviceManagement().termsAndConditions().byTermsAndConditionsId("{termsAndConditions-id}").acceptanceStatuses().byTermsAndConditionsAcceptanceStatusId("{termsAndConditionsAcceptanceStatus-id}").patch(termsAndConditionsAcceptanceStatus);
<?php
use Microsoft\Graph\GraphServiceClient;
use Microsoft\Graph\Generated\Models\TermsAndConditionsAcceptanceStatus;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new TermsAndConditionsAcceptanceStatus();
$requestBody->setOdataType('#microsoft.graph.termsAndConditionsAcceptanceStatus');
$requestBody->setUserDisplayName('User Display Name value');
$requestBody->setAcceptedVersion(15);
$requestBody->setAcceptedDateTime(new \DateTime('2016-12-31T23:57:43.6165506-08:00'));
$requestBody->setUserPrincipalName('User Principal Name value');
$result = $graphServiceClient->deviceManagement()->termsAndConditions()->byTermsAndConditionsId('termsAndConditions-id')->acceptanceStatuses()->byTermsAndConditionsAcceptanceStatusId('termsAndConditionsAcceptanceStatus-id')->patch($requestBody)->wait();
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph import GraphServiceClient
from msgraph.generated.models.terms_and_conditions_acceptance_status import TermsAndConditionsAcceptanceStatus
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = TermsAndConditionsAcceptanceStatus(
odata_type = "#microsoft.graph.termsAndConditionsAcceptanceStatus",
user_display_name = "User Display Name value",
accepted_version = 15,
accepted_date_time = "2016-12-31T23:57:43.6165506-08:00",
user_principal_name = "User Principal Name value",
)
result = await graph_client.device_management.terms_and_conditions.by_terms_and_conditions_id('termsAndConditions-id').acceptance_statuses.by_terms_and_conditions_acceptance_status_id('termsAndConditionsAcceptanceStatus-id').patch(request_body)
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: 313
{
"@odata.type": "#microsoft.graph.termsAndConditionsAcceptanceStatus",
"id": "a045ce1a-ce1a-a045-1ace-45a01ace45a0",
"userDisplayName": "User Display Name value",
"acceptedVersion": 15,
"acceptedDateTime": "2016-12-31T23:57:43.6165506-08:00",
"userPrincipalName": "User Principal Name value"
}