Criar ou substituir agendamentoCreate or replace schedule
Namespace: microsoft.graphNamespace: microsoft.graph
Criar ou substituir um objeto Schedule .Create or replace a schedule object.
O processo de criação de agendamento está em conformidade com a diretriz de uma API para operações de longa duração com base em recursos (relo).The schedule creation process conforms to the One API guideline for resource based long running operations (RELO). Quando os clientes usam o método PUT, se a agenda for provisionada, a operação substituirá a agenda; caso contrário, a operação iniciará o processo de provisionamento de agendamento em segundo plano.When clients use the PUT method, if the schedule is provisioned, the operation replaces the schedule; otherwise, the operation starts the schedule provisioning process in the background.
Durante o provisionamento de agendamento, os clientes podem usar o método Get para obter o agendamento e observar a provisionStatus
propriedade para o estado atual do provisionamento.During schedule provisioning, clients can use the GET method to get the schedule and look at the provisionStatus
property for the current state of the provisioning. Se o provisionamento falhar, os clientes poderão obter informações adicionais da provisionStatusCode
propriedade.If the provisioning failed, clients can get additional information from the provisionStatusCode
property.
Os clientes também podem inspecionar a configuração do cronograma.Clients can also inspect the configuration of the schedule.
PermissõesPermissions
Uma das seguintes permissões é obrigatória para chamar esta API. Para saber mais, incluindo como escolher permissões, confira Permissões.One of the following permissions is required to call this API. To learn more, including how to choose permissions, see Permissions.
Tipo de permissãoPermission type | Permissões (da com menos para a com mais privilégios)Permissions (from least to most privileged) |
---|---|
Delegada (conta corporativa ou de estudante)Delegated (work or school account) | Schedule. ReadWrite. All, Group. ReadWrite. AllSchedule.ReadWrite.All, Group.ReadWrite.All |
Delegada (conta pessoal da Microsoft)Delegated (personal Microsoft account) | Sem suporte.Not supported. |
AplicativoApplication | Schedule.ReadWrite.AllSchedule.ReadWrite.All |
Solicitação HTTPHTTP request
PUT /teams/{teamId}/schedule
Cabeçalhos de solicitaçãoRequest headers
CabeçalhoHeader | ValorValue |
---|---|
AutorizaçãoAuthorization | {token} de portador. Obrigatório.Bearer {token}. Required. |
Content-TypeContent-Type | application/json. Obrigatório.application/json. Required. |
Corpo da solicitaçãoRequest body
No corpo da solicitação, forneça uma representação JSON de um objeto Schedule .In the request body, supply a JSON representation of a schedule object.
RespostaResponse
Se tiver êxito, este método retornará um 200 OK
código de resposta e um objeto Schedule no corpo da resposta.If successful, this method returns a 200 OK
response code and a schedule object in the response body.
ExemploExample
SolicitaçãoRequest
Este é um exemplo de solicitação.The following is an example of the request.
PUT https://graph.microsoft.com/v1/teams/{teamId}/schedule
Content-type: application/json
{
"enabled": true,
"timeZone": "America/Chicago"
}
RespostaResponse
Este é um exemplo de resposta.The following is an example of the response.
Observação: o objeto response mostrado aqui pode ser encurtado para legibilidade. Todas as propriedades serão retornadas de uma chamada real.Note: The response object shown here might be shortened for readability. All the properties will be returned from an actual call.
HTTP/1.1 200 OK
Content-type: application/json
Content-length: 401
{
"id": "833fc4df-c88b-4398-992f-d8afcfe41df2",
"enabled": true,
"timeZone": "America/Chicago",
"provisionStatus": "Completed",
"provisionStatusCode": null,
"timeClockEnabled": true,
"openShiftsEnabled": true,
"swapShiftsRequestsEnabled": true,
"offerShiftRequestsEnabled": true,
"timeOffRequestsEnabled": true
}