En el cuerpo de la solicitud, especifique una representación JSON del objeto termsAndConditionsAcceptanceStatus.
En la tabla siguiente se muestran las propiedades necesarias para crear el objeto termsAndConditionsAcceptanceStatus.
Propiedad
Tipo
Descripción
id
Cadena
Identificador único de la entidad.
userDisplayName
Cadena
Nombre para mostrar del usuario cuya aceptación representa la entidad.
acceptedVersion
Int32
Número de versión más reciente de los TyC aceptados por el usuario.
acceptedDateTime
DateTimeOffset
Fecha y hora en la que el usuario aceptó los términos por última vez.
userPrincipalName
Cadena
UserPrincipalName del usuario que aceptó el término.
Respuesta
Si se ejecuta correctamente, este método devuelve un código de respuesta 201 Created y un objeto termsAndConditionsAcceptanceStatus en el cuerpo de la respuesta.
POST https://graph.microsoft.com/v1.0/deviceManagement/termsAndConditions/{termsAndConditionsId}/acceptanceStatuses
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.PostAsync(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().Post(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().post(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()->post($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.post(request_body)
Aquí tiene un ejemplo de la respuesta. Nota: Es posible que el objeto de respuesta que aparezca aquí esté truncado para abreviar. Todas las propiedades se devolverán desde una llamada real.
HTTP/1.1 201 Created
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"
}