Namespace: microsoft.graph
Note: The Microsoft Graph API for Intune requires an active Intune license for the tenant.
Update the properties of a termsAndConditionsAcceptanceStatus 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 |
Permissions (from least to most privileged) |
Delegated (work or school account) |
DeviceManagementServiceConfig.ReadWrite.All |
Delegated (personal Microsoft account) |
Not supported. |
Application |
DeviceManagementServiceConfig.ReadWrite.All |
HTTP Request
PATCH /deviceManagement/termsAndConditions/{termsAndConditionsId}/acceptanceStatuses/{termsAndConditionsAcceptanceStatusId}
Request body
In the request body, supply a JSON representation for the termsAndConditionsAcceptanceStatus object.
The following table shows the properties that are required when you create the termsAndConditionsAcceptanceStatus.
Property |
Type |
Description |
id |
String |
Unique identifier of the entity. |
userDisplayName |
String |
Display name of the user whose acceptance the entity represents. |
acceptedVersion |
Int32 |
Most recent version number of the T&C accepted by the user. |
acceptedDateTime |
DateTimeOffset |
DateTime when the terms were last accepted by the user. |
userPrincipalName |
String |
The userPrincipalName of the User that accepted the term. |
Response
If successful, this method returns a 200 OK
response code and an updated termsAndConditionsAcceptanceStatus object in the response body.
Example
Request
Here is an example of the request.
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);
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation.
mgc device-management terms-and-conditions acceptance-statuses patch --terms-and-conditions-id {termsAndConditions-id} --terms-and-conditions-acceptance-status-id {termsAndConditionsAcceptanceStatus-id} --body '{\
"@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"\
}\
'
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 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)
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);
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);
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);
const termsAndConditionsAcceptanceStatus = {
'@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'
};
await client.api('/deviceManagement/termsAndConditions/{termsAndConditionsId}/acceptanceStatuses/{termsAndConditionsAcceptanceStatusId}')
.update(termsAndConditionsAcceptanceStatus);
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;
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();
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation.
Import-Module Microsoft.Graph.DeviceManagement.Administration
$params = @{
"@odata.type" = "#microsoft.graph.termsAndConditionsAcceptanceStatus"
userDisplayName = "User Display Name value"
acceptedVersion = 15
acceptedDateTime = [System.DateTime]::Parse("2016-12-31T23:57:43.6165506-08:00")
userPrincipalName = "User Principal Name value"
}
Update-MgDeviceManagementTermAndConditionAcceptanceStatus -TermsAndConditionsId $termsAndConditionsId -TermsAndConditionsAcceptanceStatusId $termsAndConditionsAcceptanceStatusId -BodyParameter $params
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 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)
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation.
Response
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"
}