Namespace: microsoft.graph
Start a break in a specific timeCard.
This API is available in the following national cloud deployments.
Global service |
US Government L4 |
US Government L5 (DOD) |
China operated by 21Vianet |
✅ |
❌ |
❌ |
❌ |
Permissions
Choose the permission or permissions marked as least privileged for this API. Use a higher privileged permission or permissions only if your app requires it. For details about delegated and application permissions, see Permission types. To learn more about these permissions, see the permissions reference.
Permission type |
Least privileged permissions |
Higher privileged permissions |
Delegated (work or school account) |
Schedule.ReadWrite.All |
Not available. |
Delegated (personal Microsoft account) |
Not supported. |
Not supported. |
Application |
Schedule.ReadWrite.All |
Not available. |
Important
When you use Schedule.ReadWrite.All application permission, you must include the MS-APP-ACTS-AS
header in the request.
HTTP request
POST /teams/{teamsId}/schedule/timeCards/{timeCardId}/startBreak
Name |
Description |
Authorization |
Bearer {token}. Required. Learn more about authentication and authorization. |
Content-type |
application/json. Required. |
MS-APP-ACTS-AS |
The ID of the user on behalf of whom the app is acting. Required when you use the application permission scope. |
Request body
In the request body, provide a JSON object with the following parameters.
Parameter |
Type |
Description |
isAtApprovedLocation |
Boolean |
Indicates whether this action happens at an approved ___location. |
notes |
itemBody |
Notes for the start of the break. |
Response
If successful, this method returns a 204 No Content
response code.
Example
Request
The following example shows a request.
POST https://graph.microsoft.com/v1.0/teams/871dbd5c-3a6a-4392-bfe1-042452793a50/schedule/timeCards/TCK_29ad0a09-b97a-49a2-9490-141cb7602540/startbreak
{
"isAtApprovedLocation": true,
"notes": {
"content": "Starting break late to make up for late clockin",
"contentType": "text"
}
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Teams.Item.Schedule.TimeCards.Item.StartBreak;
using Microsoft.Graph.Models;
var requestBody = new StartBreakPostRequestBody
{
IsAtApprovedLocation = true,
Notes = new ItemBody
{
Content = "Starting break late to make up for late clockin",
ContentType = BodyType.Text,
},
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Teams["{team-id}"].Schedule.TimeCards["{timeCard-id}"].StartBreak.PostAsync(requestBody);
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"
msgraphsdk "github.com/microsoftgraph/msgraph-sdk-go"
graphteams "github.com/microsoftgraph/msgraph-sdk-go/teams"
graphmodels "github.com/microsoftgraph/msgraph-sdk-go/models"
//other-imports
)
requestBody := graphteams.NewStartBreakPostRequestBody()
isAtApprovedLocation := true
requestBody.SetIsAtApprovedLocation(&isAtApprovedLocation)
notes := graphmodels.NewItemBody()
content := "Starting break late to make up for late clockin"
notes.SetContent(&content)
contentType := graphmodels.TEXT_BODYTYPE
notes.SetContentType(&contentType)
requestBody.SetNotes(notes)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
startBreak, err := graphClient.Teams().ByTeamId("team-id").Schedule().TimeCards().ByTimeCardId("timeCard-id").StartBreak().Post(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);
com.microsoft.graph.teams.item.schedule.timecards.item.startbreak.StartBreakPostRequestBody startBreakPostRequestBody = new com.microsoft.graph.teams.item.schedule.timecards.item.startbreak.StartBreakPostRequestBody();
startBreakPostRequestBody.setIsAtApprovedLocation(true);
ItemBody notes = new ItemBody();
notes.setContent("Starting break late to make up for late clockin");
notes.setContentType(BodyType.Text);
startBreakPostRequestBody.setNotes(notes);
var result = graphClient.teams().byTeamId("{team-id}").schedule().timeCards().byTimeCardId("{timeCard-id}").startBreak().post(startBreakPostRequestBody);
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 timeCard = {
isAtApprovedLocation: true,
notes: {
content: 'Starting break late to make up for late clockin',
contentType: 'text'
}
};
await client.api('/teams/871dbd5c-3a6a-4392-bfe1-042452793a50/schedule/timeCards/TCK_29ad0a09-b97a-49a2-9490-141cb7602540/startbreak')
.post(timeCard);
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\Teams\Item\Schedule\TimeCards\Item\StartBreak\StartBreakPostRequestBody;
use Microsoft\Graph\Generated\Models\ItemBody;
use Microsoft\Graph\Generated\Models\BodyType;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new StartBreakPostRequestBody();
$requestBody->setIsAtApprovedLocation(true);
$notes = new ItemBody();
$notes->setContent('Starting break late to make up for late clockin');
$notes->setContentType(new BodyType('text'));
$requestBody->setNotes($notes);
$result = $graphServiceClient->teams()->byTeamId('team-id')->schedule()->timeCards()->byTimeCardId('timeCard-id')->startBreak()->post($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.Teams
$params = @{
isAtApprovedLocation = $true
notes = @{
content = "Starting break late to make up for late clockin"
contentType = "text"
}
}
Start-MgTeamScheduleTimeCardBreak -TeamId $teamId -TimeCardId $timeCardId -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.teams.item.schedule.timecards.item.start_break.start_break_post_request_body import StartBreakPostRequestBody
from msgraph.generated.models.item_body import ItemBody
from msgraph.generated.models.body_type import BodyType
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = StartBreakPostRequestBody(
is_at_approved_location = True,
notes = ItemBody(
content = "Starting break late to make up for late clockin",
content_type = BodyType.Text,
),
)
result = await graph_client.teams.by_team_id('team-id').schedule.time_cards.by_time_card_id('timeCard-id').start_break.post(request_body)
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation.
Response
The following example shows the response.
HTTP/1.1 204 No Content