Crear deviceManagementResourceAccessProfileAssignmentCreate deviceManagementResourceAccessProfileAssignment
Espacio de nombres: microsoft.graphNamespace: microsoft.graph
Importante: Las API de Microsoft Graph en la versión /beta están sujetas a cambios; no se admite el uso de producción.Important: Microsoft Graph APIs under the /beta version are subject to change; production use is not supported.
Nota: la API de Microsoft Graph para Intune requiere una licencia activa de Intune para el espacio empresarial.Note: The Microsoft Graph API for Intune requires an active Intune license for the tenant.
Cree un objeto deviceManagementResourceAccessProfileAssignment.Create a new deviceManagementResourceAccessProfileAssignment object.
Requisitos previosPrerequisites
Se requiere uno de los siguientes permisos para llamar a esta API. Para obtener más información, incluido cómo elegir permisos, vea Permisos.One of the following permissions is required to call this API. To learn more, including how to choose permissions, see Permissions.
Tipo de permisoPermission type | Permisos (de más a menos privilegiados)Permissions (from most to least privileged) |
---|---|
Delegado (cuenta profesional o educativa)Delegated (work or school account) | DeviceManagementServiceConfig.ReadWrite.AllDeviceManagementServiceConfig.ReadWrite.All |
Delegado (cuenta personal de Microsoft)Delegated (personal Microsoft account) | No admitida.Not supported. |
AplicaciónApplication | DeviceManagementServiceConfig.ReadWrite.AllDeviceManagementServiceConfig.ReadWrite.All |
Solicitud HTTPHTTP Request
POST /deviceManagement/resourceAccessProfiles/{deviceManagementResourceAccessProfileBaseId}/assignments
Encabezados de solicitudRequest headers
EncabezadoHeader | ValorValue |
---|---|
AuthorizationAuthorization | Se requiere <token> de portador.Bearer <token> Required. |
AceptarAccept | application/jsonapplication/json |
Cuerpo de la solicitudRequest body
En el cuerpo de la solicitud, proporcione una representación JSON del objeto deviceManagementResourceAccessProfileAssignment.In the request body, supply a JSON representation for the deviceManagementResourceAccessProfileAssignment object.
En la tabla siguiente se muestran las propiedades necesarias para crear el objeto deviceManagementResourceAccessProfileAssignment.The following table shows the properties that are required when you create the deviceManagementResourceAccessProfileAssignment.
PropiedadProperty | TipoType | DescripciónDescription |
---|---|---|
idid | StringString | Identificador único de las asignacionesUnique identifier for the Assignments |
objetivointent | deviceManagementResourceAccessProfileIntentdeviceManagementResourceAccessProfileIntent | La intención de asignación para el perfil de acceso a recursos.The assignment intent for the resource access profile. Los valores posibles son apply y remove .Possible values are: apply , remove . |
targettarget | deviceAndAppManagementAssignmentTargetdeviceAndAppManagementAssignmentTarget | Destino de asignación para el perfil de acceso a recursos.The assignment target for the resource access profile. |
sourceIdsourceId | StringString | Identificador del origen de la asignación.The identifier of the source of the assignment. |
RespuestaResponse
Si se realiza correctamente, este método devuelve un código de respuesta y un 201 Created
objeto deviceManagementResourceAccessProfileAssignment en el cuerpo de la respuesta.If successful, this method returns a 201 Created
response code and a deviceManagementResourceAccessProfileAssignment object in the response body.
EjemploExample
SolicitudRequest
Aquí tiene un ejemplo de la solicitud.Here is an example of the request.
POST https://graph.microsoft.com/beta/deviceManagement/resourceAccessProfiles/{deviceManagementResourceAccessProfileBaseId}/assignments
Content-type: application/json
Content-length: 463
{
"@odata.type": "#microsoft.graph.deviceManagementResourceAccessProfileAssignment",
"intent": "remove",
"target": {
"@odata.type": "microsoft.graph.configurationManagerCollectionAssignmentTarget",
"deviceAndAppManagementAssignmentFilterId": "Device And App Management Assignment Filter Id value",
"deviceAndAppManagementAssignmentFilterType": "include",
"collectionId": "Collection Id value"
},
"sourceId": "Source Id value"
}
RespuestaResponse
Aquí tiene un ejemplo de la respuesta. Nota: Puede que el objeto de respuesta que aparece aquí se trunque para abreviar. Todas las propiedades se devolverán de una llamada real.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 201 Created
Content-Type: application/json
Content-Length: 512
{
"@odata.type": "#microsoft.graph.deviceManagementResourceAccessProfileAssignment",
"id": "4ebb8d4e-8d4e-4ebb-4e8d-bb4e4e8dbb4e",
"intent": "remove",
"target": {
"@odata.type": "microsoft.graph.configurationManagerCollectionAssignmentTarget",
"deviceAndAppManagementAssignmentFilterId": "Device And App Management Assignment Filter Id value",
"deviceAndAppManagementAssignmentFilterType": "include",
"collectionId": "Collection Id value"
},
"sourceId": "Source Id value"
}