| title | Update workforceintegration |
|---|---|
| description | Update the properties of a workforceintegration object. |
| ms.localizationpriority | medium |
| author | akumar39 |
| ms.subservice | teams |
| doc_type | apiPageType |
| ms.date | 06/11/2024 |
Namespace: microsoft.graph
[!INCLUDE beta-disclaimer]
Update the properties of a workforceintegration object.
[!INCLUDE national-cloud-support]
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.
[!INCLUDE permissions-table]
PATCH /teamwork/workforceIntegrations/{workforceIntegrationId}| Name | Description |
|---|---|
| Authorization | Bearer {token}. Required. Learn more about authentication and authorization. |
| MS-APP-ACTS-AS (deprecated) | A user ID (GUID). Required only if the authorization token is an application token; otherwise, optional. The MS-APP-ACTS-AS header is deprecated and no longer required with application tokens. |
In the request body, supply the values for relevant fields that should be updated. Existing properties that aren't included in the request body maintains their previous values or be recalculated based on changes to other property values. For best performance, don't include existing values that haven't changed.
| Property | Type | Description |
|---|---|---|
| apiVersion | Int32 | API version for the callback url. Start with 1. |
| displayName | String | Name of the workforce integration. |
| encryption | workforceIntegrationEncryption | The workforce integration encryption resource. |
| isActive | Boolean | Indicates whether this workforce integration is currently active and available. |
| supports | string | Possible values are none, shift, swapRequest, openshift, openShiftRequest, userShiftPreferences. If selecting more than one value, all values must start with the first letter in uppercase. |
| supportedEntities | string | This property replaces supports in v1.0. We recommend that you use this property instead of supports. The supports property will still be supported in beta for the time being. Possible values are none, shift, swapRequest, openshift, openShiftRequest, userShiftPreferences. If selecting more than one value, all values must start with the first letter in uppercase. |
| url | String | Workforce Integration url for callbacks from the Shift service. |
If successful, this method returns a 200 OK response code and an updated workforceIntegration object in the response body.
The following example updates a workforceIntegration object.
The following example shows a request.
PATCH https://graph.microsoft.com/beta/teamwork/workforceIntegrations/{workforceIntegrationId}
Content-type: application/json
{
"displayName": "displayName-value",
"apiVersion": 99,
"encryption": {
"protocol": "protocol-value",
"secret": "secret-value"
},
"isActive": true,
"url": "url-value",
"supports": "supports-value"
}[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
The following example shows the response.
Note: The response object shown here might be shortened for readability.
HTTP/1.1 200 OK
Content-type: application/json
{
"displayName": "displayName-value",
"apiVersion": 99,
"encryption": {
"protocol": "protocol-value",
"secret": "secret-value"
},
"isActive": true,
"url": "url-value",
"supports": "supports-value"
}The following example creates a new workforceIntegration with SwapRequest enabled for eligibility filtering.
The following example shows a request.
POST https://graph.microsoft.com/beta/teamwork/workforceIntegrations/
Authorization: Bearer {token}
Content-type: application/json
{
"displayName": "ABCWorkforceIntegration",
"apiVersion": 1,
"isActive": true,
"encryption": {
"protocol": "sharedSecret",
"secret": "My Secret"
},
"url": "https://ABCWorkforceIntegration.com/Contoso/",
"supports": "Shift,SwapRequest",
"eligibilityFilteringEnabledEntities": "SwapRequest"
}
The following example shows the response.
HTTP/1.1 200 OK
{
"id": "c5d0c76b-80c4-481c-be50-923cd8d680a1",
"displayName": "ABCWorkforceIntegration",
"apiVersion": 1,
"isActive": true,
"encryption": {
"protocol": "sharedSecret",
"secret": null
},
"url": "https://abcWorkforceIntegration.com/Contoso/",
"supports": "Shift,SwapRequest",
"eligibilityFilteringEnabledEntities": "SwapRequest"
}
To create a new workforceIntegration with SwapRequest enabled for eligibility filtering, see the Create method.
Example 3: Fetching eligible shifts when SwapRequest is included in eligibilityFilteringEnabledEntities
The interaction between Shifts app and workforce integration endpoints follow the existing pattern.
The following example shows a request made by Shifts to the workforce integration endpoint to fetch eligible shifts for a swap request.
POST https://abcWorkforceIntegration.com/Contoso/{apiVersion}/team/{teamId}/read
Accept-Language: en-us
{
"requests": [
{
"id": "{shiftId}",
"method": "GET”,
"url": “/shifts/{shiftId}/requestableShifts?requestType={requestType}&startDateTime={startDateTime}&endDateTime={endDateTime}”
}]
}
Here's an example of the response from the workforce integration service.
HTTP/1.1 200 OK
{
"responses": [
{
"body": {
"SHFT_6548f642-cbc1-4228-8621-054327576457",
"SHFT_6548f642-cbc1-4228-8621-054327571234"
}
"id": "{shiftId}",
"status: 200,
"body": {
"data": [{ShiftId}, {ShiftId}...]
"error": null
}
]
}
Example 4: Shifts synchronous callback to the workforce integration endpoint when enabled for real time notifications on timeCard changes.
The following example shows a request.
POST https://foobarWorkforceIntegration.com/foobar/v1/teams/788b75d2-a911-48c0-a5e2-dc98480457e3/update
Accept-Language: en-us
X-MS-WFMPassthrough: foobarvalue
Content-type: application/json
{
"requests":[
{
"id":"1",
"method":"POST",
"url":"/timecards",
"headers":{
"X-MS-Transaction-ID":"1"
},
"body":{
"id":"3895809b-a618-4c0d-86a0-d42b25b7d74f",
"userId":"a3601044-a1b5-438e-b742-f78d01d68a67",
"createdDateTime":"2019-03-18T00:00:00.000Z",
"createdBy":{
"user":{
"id":"a3601044-a1b5-438e-b742-f78d01d68a67",
"displayName":"Dwight Schrute"
}
},
"lastModifiedDateTime":"2019-03-18T00:00:00.000Z",
"lastModifiedBy":{
"user":{
"id":"a3601044-a1b5-438e-b742-f78d01d68a67",
"displayName":"Dwight Schrute"
}
},
"state":"onBreak",
"clockIn":{
"dateTime":"2019-03-18T00:00:00.000Z",
"atApprovedLocation":true,
"notes":null
},
"clockOut":null,
"breaks":[
{
"id":"string",
"notes":{
"content":"Lunch break",
"contentType":"text"
},
"start":{
"dateTime":"2019-03-18T00:00:00.000Z",
"atApprovedLocation":true,
"notes":{
"content":"Started my break 5 minutes early",
"contentType":"text"
}
},
"end":null
}
],
"notes":null,
"originalEntry":{
"clockIn":{
"dateTime":"2019-03-18T00:00:00.000Z",
"atApprovedLocation":true,
"notes":null
},
"clockOut":null,
"breaks":[
{
"id":"4591109b-a618-3e0d-e6a0-d42b25b7231f",
"notes":{
"content":"Lunch break",
"contentType":"text"
},
"start":{
"dateTime":"2019-03-18T00:00:00.000Z",
"atApprovedLocation":true,
"notes":{
"content":"Started my break 5 minutes early",
"contentType":"text"
}
},
"end":null
}
]
}
}
}
]
}
The following example shows the response.
HTTP/1.1 200 OK
Content-type: application/json
{
"responses":[
{
"id": "1",
"status": 200,
"body":{
"eTag": "4000ee23-0000-0700-0000-5d1415f60000",
"error": null
}
}
]
}