Elija el permiso o los permisos marcados como con privilegios mínimos para esta API. Use un permiso o permisos con privilegios superiores solo si la aplicación lo requiere. Para obtener más información sobre los permisos delegados y de aplicación, consulte Tipos de permisos. Para obtener más información sobre estos permisos, consulte la referencia de permisos.
Tipo de permiso
Permisos con privilegios mínimos
Permisos con privilegios más altos
Delegado (cuenta profesional o educativa)
WorkforceIntegration.ReadWrite.All
No disponible.
Delegado (cuenta personal de Microsoft)
No admitida.
No admitida.
Aplicación
No admitida.
No admitida.
Nota: esta API admite permisos de administrador. Los usuarios con roles de administrador pueden acceder a grupos de los que no son miembros.
Un identificador de usuario (GUID). Solo se requiere si el token de autorización es un token de aplicación; De lo contrario, es opcional.
Cuerpo de la solicitud
En el cuerpo de la solicitud, proporcione una representación JSON del objeto workforceIntegration .
En la tabla siguiente se enumeran las propiedades que puede usar al crear un objeto workforceIntegration .
Propiedad
Tipo
Descripción
apiVersion
Int32
Versión de API para la dirección URL de devolución de llamada. Comience con 1.
displayName
Cadena
Nombre de la integración del personal.
eligibilityFilteringEnabledEntities
eligibilityFilteringEnabledEntities
Compatibilidad para ver los resultados filtrados por idoneidad. Los valores posibles son: none, swapRequest, offerShiftRequest, unknownFutureValue y timeOffReason. Use el encabezado de Prefer: include-unknown-enum-members solicitud para obtener el siguiente valor en esta enumeración evolvable: timeOffReason.
Recurso de cifrado de integración de la fuerza de trabajo.
isActive
Booleano
Indica si esta integración del personal está activa y disponible actualmente.
supportedEntities
workforceIntegrationSupportedEntities
Las entidades Shifts admitidas para las notificaciones de cambio sincrónicas. Los turnos llaman a la dirección URL proporcionada cuando se producen cambios en el cliente en las entidades especificadas en esta propiedad. De forma predeterminada, no se admite ninguna entidad para las notificaciones de cambio. Los valores posibles son: none, shift, swapRequest, userShiftPreferences, openShift, openShiftRequest, offerShiftRequest, unknownFutureValue, timeCard, timeOffReason, timeOff y timeOffRequest. Use el encabezado de Prefer: include-unknown-enum-members solicitud para obtener los siguientes valores en esta enumeración evolvable: timeCard, timeOffReason , timeOff , timeOffRequest.
URL
Cadena
Dirección URL de integración de Workforce usada para las devoluciones de llamada del servicio Shifts.
Respuesta
Si se ejecuta correctamente, este método devuelve un 201 Created código de respuesta y un nuevo objeto workforceIntegration en el cuerpo de la respuesta.
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Models;
var requestBody = new WorkforceIntegration
{
DisplayName = "ABCWorkforceIntegration",
ApiVersion = 1,
IsActive = true,
Encryption = new WorkforceIntegrationEncryption
{
Protocol = WorkforceIntegrationEncryptionProtocol.SharedSecret,
Secret = "My Secret",
},
Url = "https://ABCWorkforceIntegration.com/Contoso/",
SupportedEntities = WorkforceIntegrationSupportedEntities.Shift | WorkforceIntegrationSupportedEntities.SwapRequest,
EligibilityFilteringEnabledEntities = EligibilityFilteringEnabledEntities.SwapRequest,
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Teamwork.WorkforceIntegrations.PostAsync(requestBody);
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
WorkforceIntegration workforceIntegration = new WorkforceIntegration();
workforceIntegration.setDisplayName("ABCWorkforceIntegration");
workforceIntegration.setApiVersion(1);
workforceIntegration.setIsActive(true);
WorkforceIntegrationEncryption encryption = new WorkforceIntegrationEncryption();
encryption.setProtocol(WorkforceIntegrationEncryptionProtocol.SharedSecret);
encryption.setSecret("My Secret");
workforceIntegration.setEncryption(encryption);
workforceIntegration.setUrl("https://ABCWorkforceIntegration.com/Contoso/");
workforceIntegration.setSupportedEntities(EnumSet.of(WorkforceIntegrationSupportedEntities.Shift, WorkforceIntegrationSupportedEntities.SwapRequest));
workforceIntegration.setEligibilityFilteringEnabledEntities(EnumSet.of(EligibilityFilteringEnabledEntities.SwapRequest));
WorkforceIntegration result = graphClient.teamwork().workforceIntegrations().post(workforceIntegration);
<?php
use Microsoft\Graph\GraphServiceClient;
use Microsoft\Graph\Generated\Models\WorkforceIntegration;
use Microsoft\Graph\Generated\Models\WorkforceIntegrationEncryption;
use Microsoft\Graph\Generated\Models\WorkforceIntegrationEncryptionProtocol;
use Microsoft\Graph\Generated\Models\WorkforceIntegrationSupportedEntities;
use Microsoft\Graph\Generated\Models\EligibilityFilteringEnabledEntities;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new WorkforceIntegration();
$requestBody->setDisplayName('ABCWorkforceIntegration');
$requestBody->setApiVersion(1);
$requestBody->setIsActive(true);
$encryption = new WorkforceIntegrationEncryption();
$encryption->setProtocol(new WorkforceIntegrationEncryptionProtocol('sharedSecret'));
$encryption->setSecret('My Secret');
$requestBody->setEncryption($encryption);
$requestBody->setUrl('https://ABCWorkforceIntegration.com/Contoso/');
$requestBody->setSupportedEntities(new WorkforceIntegrationSupportedEntities('shift,SwapRequest'));
$requestBody->setEligibilityFilteringEnabledEntities(new EligibilityFilteringEnabledEntities('swapRequest'));
$result = $graphServiceClient->teamwork()->workforceIntegrations()->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.workforce_integration import WorkforceIntegration
from msgraph.generated.models.workforce_integration_encryption import WorkforceIntegrationEncryption
from msgraph.generated.models.workforce_integration_encryption_protocol import WorkforceIntegrationEncryptionProtocol
from msgraph.generated.models.workforce_integration_supported_entities import WorkforceIntegrationSupportedEntities
from msgraph.generated.models.eligibility_filtering_enabled_entities import EligibilityFilteringEnabledEntities
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = WorkforceIntegration(
display_name = "ABCWorkforceIntegration",
api_version = 1,
is_active = True,
encryption = WorkforceIntegrationEncryption(
protocol = WorkforceIntegrationEncryptionProtocol.SharedSecret,
secret = "My Secret",
),
url = "https://ABCWorkforceIntegration.com/Contoso/",
supported_entities = WorkforceIntegrationSupportedEntities.Shift | WorkforceIntegrationSupportedEntities.SwapRequest,
eligibility_filtering_enabled_entities = EligibilityFilteringEnabledEntities.SwapRequest,
)
result = await graph_client.teamwork.workforce_integrations.post(request_body)
Para ver cómo actualizar una plantilla existenteIntegración con SwapRequest habilitado para el filtrado de idoneidad, consulte Actualización.
Ejemplo de captura de turnos válidos cuando SwapRequest se incluye en eligibilityFilteringEnabledEntities
La interacción entre la aplicación Shifts y los puntos de conexión de integración del personal sigue el patrón existente.
Solicitud
En este ejemplo se muestra una solicitud realizada por Shifts al punto de conexión de integración del personal para capturar turnos aptos para una solicitud de intercambio.