Skip to content

Commit e2aafd2

Browse files
authored
Merge pull request #26659 from microsoftgraph/user/lemike/timeCardUpdate
Add documentation for `onBehalfOfUserId` parameter in TimeCard ClockIn
2 parents 2c251b1 + 3a2b319 commit e2aafd2

File tree

3 files changed

+198
-8
lines changed

3 files changed

+198
-8
lines changed

api-reference/beta/api/timecard-clockin.md

Lines changed: 82 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,17 @@ In the request body, provide a JSON object with the following parameters.
5353
|isAtApprovedLocation|Boolean|Indicates whether this action happens at an approved location.|
5454
|notes|[itemBody](../resources/itembody.md)|Notes for the clock in.|
5555
|atApprovedLocation (deprecated)|Boolean|Indicates whether this action happens at an approved location. This property will be removed by November 27, 2027. Use `isAtApprovedLocation` instead. `atApprovedLocation` and `isAtApprovedLocation` always have the same value, so setting one automatically sets the value for the other. If both are included in the request with different values, the value for `isAtApprovedLocation` takes precedence.|
56+
|onBehalfOfUserId|string|The ID of the user you are clocking in on behalf of.|
5657

5758
## Response
5859

5960
If successful, this method returns a `201 Created` response code and a [timeCard](../resources/timeCard.md) object in the response body.
6061

61-
## Example
62+
## Examples
6263

63-
### Request
64+
### Example 1: Clock in as yourself
65+
66+
#### Request
6467
The following example shows a request.
6568

6669
# [HTTP](#tab/http)
@@ -116,7 +119,7 @@ Content-type: application/json
116119

117120
---
118121

119-
### Response
122+
#### Response
120123

121124
The following example shows the response.
122125

@@ -184,6 +187,81 @@ Content-type: application/json
184187
}
185188
```
186189

190+
### Example 2: Clock in on behalf of another user
191+
192+
#### Request
193+
194+
The following example shows a request.
195+
<!-- {
196+
"blockType": "request",
197+
"name": "timecard-clockin2"
198+
}
199+
-->
200+
``` http
201+
POST https://graph.microsoft.com/beta/teams/fd15cad8-80f6-484f-9666-3caf695fbf32/schedule/timeCards/clockin
202+
Content-type: application/json
203+
204+
{
205+
"isAtApprovedLocation": true,
206+
"onBehalfOfUserId": "3f29c8e7-7a41-4d8e-99d6-2b1f76c9421e"
207+
}
208+
```
209+
210+
#### Response
211+
212+
The following example shows the response.
213+
<!-- {
214+
"blockType": "response",
215+
"truncated": true,
216+
"@odata.type": "microsoft.graph.timeCard"
217+
} -->
218+
```http
219+
HTTP/1.1 201 Created
220+
Content-type: application/json
221+
222+
{
223+
"id": "TCK_95c44dff-bc12-4de2-8a9a-9772e4421eb4",
224+
"createdDateTime": "2025-05-07T21:35:36.311Z",
225+
"lastModifiedDateTime": "2025-05-07T21:35:36.311Z",
226+
"userId": "3f29c8e7-7a41-4d8e-99d6-2b1f76c9421e",
227+
"state": "clockedIn",
228+
"confirmedBy": "none",
229+
"clockOutEvent": null,
230+
"notes": null,
231+
"lastModifiedBy": {
232+
"application": null,
233+
"device": null,
234+
"user": {
235+
"id": "d56f3e8a-2b0f-42b1-88b9-e2dbd12a34d2",
236+
"displayName": "Alice Bradford"
237+
}
238+
},
239+
"clockInEvent": {
240+
"dateTime": "2025-05-07T21:35:36.311Z",
241+
"isAtApprovedLocation": true,
242+
"notes": null
243+
},
244+
"breaks": [],
245+
"originalEntry": {
246+
"clockOutEvent": null,
247+
"clockInEvent": {
248+
"dateTime": "2025-05-07T21:35:36.311Z",
249+
"isAtApprovedLocation": true,
250+
"notes": null
251+
},
252+
"breaks": []
253+
},
254+
"createdBy": {
255+
"application": null,
256+
"device": null,
257+
"user": {
258+
"id": "d56f3e8a-2b0f-42b1-88b9-e2dbd12a34d2",
259+
"displayName": "Alice Bradford"
260+
}
261+
}
262+
}
263+
```
264+
187265
<!-- uuid: 8fcb5dbc-d5aa-4681-8e31-b001d5168d79
188266
2015-10-25 14:57:30 UTC -->
189267
<!--
@@ -196,4 +274,4 @@ Content-type: application/json
196274
"suppressions": [
197275
]
198276
}
199-
-->
277+
-->

api-reference/v1.0/api/timecard-clockin.md

Lines changed: 80 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,16 @@ In the request body, provide a JSON object with the following parameters.
5252
|:---|:---|:---|
5353
|isAtApprovedLocation|Boolean|Indicates whether this action happens at an approved location.|
5454
|notes|[itemBody](../resources/itembody.md)|Notes for the clock in.|
55+
|onBehalfOfUserId|string|The ID of the user you are clocking in on behalf of.|
5556

5657
## Response
5758

5859
If successful, this method returns a `201 Created` response code and a [timeCard](../resources/timeCard.md) object in the response body.
5960

60-
## Example
61+
## Examples
6162

62-
### Request
63+
### Example 1: Clock in as yourself
64+
#### Request
6365
The following example shows a request.
6466

6567
# [HTTP](#tab/http)
@@ -115,7 +117,7 @@ Content-type: application/json
115117

116118
---
117119

118-
### Response
120+
#### Response
119121

120122
The following example shows the response.
121123

@@ -127,7 +129,7 @@ The following example shows the response.
127129
} -->
128130

129131
```http
130-
HTTP/1.1 200 OK
132+
HTTP/1.1 201 Created
131133
Content-type: application/json
132134
133135
{
@@ -179,3 +181,77 @@ Content-type: application/json
179181
}
180182
```
181183

184+
### Example 2: Clock in on behalf of another user
185+
186+
#### Request
187+
188+
The following example shows a request.
189+
<!-- {
190+
"blockType": "request",
191+
"name": "timecardthis.clockin2"
192+
}
193+
-->
194+
``` http
195+
POST https://graph.microsoft.com/v1.0/teams/fd15cad8-80f6-484f-9666-3caf695fbf32/schedule/timeCards/clockin
196+
Content-type: application/json
197+
198+
{
199+
"isAtApprovedLocation": true,
200+
"onBehalfOfUserId": "3f29c8e7-7a41-4d8e-99d6-2b1f76c9421e"
201+
}
202+
```
203+
204+
#### Response
205+
206+
The following example shows the response.
207+
<!-- {
208+
"blockType": "response",
209+
"truncated": true,
210+
"@odata.type": "microsoft.graph.timeCard"
211+
} -->
212+
```http
213+
HTTP/1.1 201 Created
214+
Content-type: application/json
215+
216+
{
217+
"id": "TCK_95c44dff-bc12-4de2-8a9a-9772e4421eb4",
218+
"createdDateTime": "2025-05-07T21:35:36.311Z",
219+
"lastModifiedDateTime": "2025-05-07T21:35:36.311Z",
220+
"userId": "3f29c8e7-7a41-4d8e-99d6-2b1f76c9421e",
221+
"state": "clockedIn",
222+
"confirmedBy": "none",
223+
"clockOutEvent": null,
224+
"notes": null,
225+
"lastModifiedBy": {
226+
"application": null,
227+
"device": null,
228+
"user": {
229+
"id": "d56f3e8a-2b0f-42b1-88b9-e2dbd12a34d2",
230+
"displayName": "Alice Bradford"
231+
}
232+
},
233+
"clockInEvent": {
234+
"dateTime": "2025-05-07T21:35:36.311Z",
235+
"isAtApprovedLocation": true,
236+
"notes": null
237+
},
238+
"breaks": [],
239+
"originalEntry": {
240+
"clockOutEvent": null,
241+
"clockInEvent": {
242+
"dateTime": "2025-05-07T21:35:36.311Z",
243+
"isAtApprovedLocation": true,
244+
"notes": null
245+
},
246+
"breaks": []
247+
},
248+
"createdBy": {
249+
"application": null,
250+
"device": null,
251+
"user": {
252+
"id": "d56f3e8a-2b0f-42b1-88b9-e2dbd12a34d2",
253+
"displayName": "Alice Bradford"
254+
}
255+
}
256+
}
257+
```

changelog/Microsoft.Teams.Shifts.json

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -987,6 +987,42 @@
987987
"CreatedDateTime": "2025-05-22T20:09:47.8551915Z",
988988
"WorkloadArea": "Teamwork and communications",
989989
"SubArea": "Shift management"
990+
},
991+
{
992+
"ChangeList": [
993+
{
994+
"Id": "320fa69d-9d6f-4f95-ab0d-febf4ad358cb",
995+
"ApiChange": "Parameter",
996+
"ChangedApiName": "onBehalfOfUserId",
997+
"ChangeType": "Addition",
998+
"Description": "Added the `onBehalfOfUserId` parameter to the [clockIn](https://learn.microsoft.com/en-us/graph/api/timeCard?view=graph-rest-1.0) method.",
999+
"Target": "clockIn"
1000+
}
1001+
],
1002+
"Id": "320fa69d-9d6f-4f95-ab0d-febf4ad358cb",
1003+
"Cloud": "Prod",
1004+
"Version": "v1.0",
1005+
"CreatedDateTime": "2025-05-15T22:49:05.1424181Z",
1006+
"WorkloadArea": "Teamwork",
1007+
"SubArea": ""
1008+
},
1009+
{
1010+
"ChangeList": [
1011+
{
1012+
"Id": "320fa69d-9d6f-4f95-ab0d-febf4ad358cb",
1013+
"ApiChange": "Parameter",
1014+
"ChangedApiName": "onBehalfOfUserId",
1015+
"ChangeType": "Addition",
1016+
"Description": "Added the `onBehalfOfUserId` parameter to the [clockIn](https://learn.microsoft.com/en-us/graph/api/timeCard?view=graph-rest-1.0) method.",
1017+
"Target": "clockIn"
1018+
}
1019+
],
1020+
"Id": "320fa69d-9d6f-4f95-ab0d-febf4ad358cb",
1021+
"Cloud": "Prod",
1022+
"Version": "beta",
1023+
"CreatedDateTime": "2025-05-15T22:49:05.1424181Z",
1024+
"WorkloadArea": "Teamwork",
1025+
"SubArea": ""
9901026
}
9911027
]
9921028
}

0 commit comments

Comments
 (0)