Replace timeCard
Namespace: microsoft.graph
Important
APIs under the /beta
version in Microsoft Graph are subject to change. Use of these APIs in production applications is not supported. To determine whether an API is available in v1.0, use the Version selector.
Replace an existing timeCard with updated values.
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 the Schedule.ReadWrite.All application permission, you must include the MS-APP-ACTS-AS
header in the request.
HTTP request
PUT /teams/{teamId}/schedule/timeCards/{timeCardID}
Request headers
Header | Value |
---|---|
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, supply a JSON representation of a timeCard object.
Response
If successful, this method returns a 204 No Content
response code.
Examples
Request
The following example shows a request.
PUT https://graph.microsoft.com/beta/teams/fd15cad8-80f6-484f-9666-3caf695fbf32/schedule/timeCards/TCK_3cd7413f-0337-433b-9a49-da0923185b3f
Content-type: application/json
{
"userId": "70e47528-2fae-42b5-9d8e-ee73ccd90603",
"state": "clockedOut",
"confirmedBy": "None",
"notes": null,
"clockInEvent": {
"dateTime": "2021-05-21T21:58:41.327Z",
"atApprovedLocation": null,
"notes": {
"contentType": "text",
"content": "update sample notes"
}
},
"clockOutEvent": {
"dateTime": "2021-05-21T22:01:46.205Z",
"atApprovedLocation": null,
"notes": {
"contentType": "text",
"content": "update sample notes"
}
},
"breaks": [
{
"breakId": "BRK_138f4751-68b1-44c1-aca2-2b26cba9e73f",
"notes": null,
"start": {
"dateTime": "2021-05-21T21:59:59.328Z",
"atApprovedLocation": null,
"notes": {
"contentType": "text",
"content": "update sample notes"
}
},
"end": {
"dateTime": "2021-05-21T22:01:10.205Z",
"atApprovedLocation": null,
"notes": {
"contentType": "text",
"content": "update sample notes"
}
}
}
]
}
Response
The following example shows the response.
HTTP/1.1 204 No Content