workforceIntegration の更新
-
[アーティクル]
-
-
名前空間: microsoft.graph
workforceIntegration オブジェクトのプロパティを更新します。
アクセス許可
この API を呼び出すには、次のいずれかのアクセス許可が必要です。アクセス許可の選択方法などの詳細については、「アクセス許可」を参照してください。
| アクセス許可の種類 |
アクセス許可 (特権の小さいものから大きいものへ) |
| 委任 (職場または学校のアカウント) |
WorkforceIntegration.ReadWrite.All |
| 委任 (個人用 Microsoft アカウント) |
サポートされていません。 |
| アプリケーション |
サポートされていません。 |
注: この API は、管理者のアクセス許可をサポートします。 グローバル管理者は、メンバーではないグループにアクセスできます。
HTTP 要求
PATCH /teamwork/workforceIntegrations/{workforceIntegrationId}
| 名前 |
説明 |
| Authorization |
ベアラー {トークン} |
要求本文
要求本文で、更新する関連フィールドの値を指定します。 要求本文に含まれない既存のプロパティは、以前の値のままになるか、他のプロパティ値の変化に基づいて再計算されます。 最適なパフォーマンスを得るために、変更されていない既存の値を含めないでください。
| プロパティ |
種類 |
説明 |
| apiVersion |
Int32 |
呼び出しの URL の API バージョン。 1 から始める。 |
| displayName |
文字列 |
従業員統合の名前。 |
| 暗号化 |
workforceIntegrationEncryption |
従業員統合暗号化リソース。 |
| isActive |
Boolean |
この従業員統合が現在アクティブで使用可能かどうかを示します。 |
| supportedEntities |
string |
使用可能な値: none、shift、swapRequest、openshift、openShiftRequest、userShiftPreferences。 複数の値を選択する場合、すべての値は大文字の最初の文字で始まる必要があります。 |
| url |
String |
シフト サービスからのコールバックのワークフォース統合 URL。 |
応答
成功した場合、このメソッドは応答コードと、応答本文で 200 OK 更新された workforceIntegration オブジェクトを返します。
例
要求
要求の例を次に示します。
PATCH https://graph.microsoft.com/v1.0/teamwork/workforceIntegrations/{workforceIntegrationId}
Content-type: application/json
{
"displayName": "displayName-value",
"apiVersion": 99,
"encryption": {
"protocol": "protocol-value",
"secret": "secret-value"
},
"isActive": true,
"url": "url-value",
"supportedEntities": "supportedEntities-value"
}
GraphServiceClient graphClient = new GraphServiceClient( authProvider );
var workforceIntegration = new WorkforceIntegration
{
DisplayName = "displayName-value",
ApiVersion = 99,
Encryption = new WorkforceIntegrationEncryption
{
Protocol = WorkforceIntegrationEncryptionProtocol.SharedSecret,
Secret = "secret-value"
},
IsActive = true,
Url = "url-value",
SupportedEntities = WorkforceIntegrationSupportedEntities.None
};
await graphClient.Teamwork.WorkforceIntegrations["{workforceIntegration-id}"]
.Request()
.UpdateAsync(workforceIntegration);
SDK をプロジェクトに追加し、authProvider インスタンスを作成する方法の詳細については、SDK のドキュメントを参照してください。
const options = {
authProvider,
};
const client = Client.init(options);
const workforceIntegration = {
displayName: 'displayName-value',
apiVersion: 99,
encryption: {
protocol: 'protocol-value',
secret: 'secret-value'
},
isActive: true,
url: 'url-value',
supportedEntities: 'supportedEntities-value'
};
await client.api('/teamwork/workforceIntegrations/{workforceIntegrationId}')
.update(workforceIntegration);
SDK をプロジェクトに追加し、authProvider インスタンスを作成する方法の詳細については、SDK のドキュメントを参照してください。
MSHTTPClient *httpClient = [MSClientFactory createHTTPClientWithAuthenticationProvider:authenticationProvider];
NSString *MSGraphBaseURL = @"https://graph.microsoft.com/v1.0/";
NSMutableURLRequest *urlRequest = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:[MSGraphBaseURL stringByAppendingString:@"/teamwork/workforceIntegrations/{workforceIntegrationId}"]]];
[urlRequest setHTTPMethod:@"PATCH"];
[urlRequest setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
MSGraphWorkforceIntegration *workforceIntegration = [[MSGraphWorkforceIntegration alloc] init];
[workforceIntegration setDisplayName:@"displayName-value"];
[workforceIntegration setApiVersion: 99];
MSGraphWorkforceIntegrationEncryption *encryption = [[MSGraphWorkforceIntegrationEncryption alloc] init];
[encryption setProtocol: [MSGraphWorkforceIntegrationEncryptionProtocol sharedSecret]];
[encryption setSecret:@"secret-value"];
[workforceIntegration setEncryption:encryption];
[workforceIntegration setIsActive: true];
[workforceIntegration setUrl:@"url-value"];
[workforceIntegration setSupportedEntities: [MSGraphWorkforceIntegrationSupportedEntities none]];
NSError *error;
NSData *workforceIntegrationData = [workforceIntegration getSerializedDataWithError:&error];
[urlRequest setHTTPBody:workforceIntegrationData];
MSURLSessionDataTask *meDataTask = [httpClient dataTaskWithRequest:urlRequest
completionHandler: ^(NSData *data, NSURLResponse *response, NSError *nserror) {
//Request Completed
}];
[meDataTask execute];
SDK をプロジェクトに追加し、authProvider インスタンスを作成する方法の詳細については、SDK のドキュメントを参照してください。
GraphServiceClient graphClient = GraphServiceClient.builder().authenticationProvider( authProvider ).buildClient();
WorkforceIntegration workforceIntegration = new WorkforceIntegration();
workforceIntegration.displayName = "displayName-value";
workforceIntegration.apiVersion = 99;
WorkforceIntegrationEncryption encryption = new WorkforceIntegrationEncryption();
encryption.protocol = WorkforceIntegrationEncryptionProtocol.SHARED_SECRET;
encryption.secret = "secret-value";
workforceIntegration.encryption = encryption;
workforceIntegration.isActive = true;
workforceIntegration.url = "url-value";
workforceIntegration.supportedEntities = EnumSet.of(WorkforceIntegrationSupportedEntities.NONE);
graphClient.teamwork().workforceIntegrations("{workforceIntegrationId}")
.buildRequest()
.patch(workforceIntegration);
SDK をプロジェクトに追加し、authProvider インスタンスを作成する方法の詳細については、SDK のドキュメントを参照してください。
//THE GO SDK IS IN PREVIEW. NON-PRODUCTION USE ONLY
graphClient := msgraphsdk.NewGraphServiceClient(requestAdapter)
requestBody := msgraphsdk.NewWorkforceIntegration()
displayName := "displayName-value"
requestBody.SetDisplayName(&displayName)
apiVersion := int32(99)
requestBody.SetApiVersion(&apiVersion)
encryption := msgraphsdk.NewWorkforceIntegrationEncryption()
requestBody.SetEncryption(encryption)
protocol := "protocol-value"
encryption.SetProtocol(&protocol)
secret := "secret-value"
encryption.SetSecret(&secret)
isActive := true
requestBody.SetIsActive(&isActive)
url := "url-value"
requestBody.SetUrl(&url)
supportedEntities := "supportedEntities-value"
requestBody.SetSupportedEntities(&supportedEntities)
workforceIntegrationId := "workforceIntegration-id"
graphClient.Teamwork().WorkforceIntegrationsById(&workforceIntegrationId).Patch(requestBody)
SDK をプロジェクトに追加し、authProvider インスタンスを作成する方法の詳細については、SDK のドキュメントを参照してください。
Import-Module Microsoft.Graph.Teams
$params = @{
DisplayName = "displayName-value"
ApiVersion = 99
Encryption = @{
Protocol = "protocol-value"
Secret = "secret-value"
}
IsActive = $true
Url = "url-value"
SupportedEntities = "supportedEntities-value"
}
Update-MgTeamworkWorkforceIntegration -WorkforceIntegrationId $workforceIntegrationId -BodyParameter $params
SDK をプロジェクトに追加し、authProvider インスタンスを作成する方法の詳細については、SDK のドキュメントを参照してください。
応答
応答の例を次に示します。
注: ここに示す応答オブジェクトは、読みやすさのために短縮されている場合があります。
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",
"supportedEntities": "supportedEntities-value"
}
例 WFM ルールの適格性によるフィルター処理の WorkforceIntegration エンティティの使用例
使用例: 既存の WorkforceIntegration を置き換え、SwapRequest で適格性フィルターを有効にする
要求
要求の例を次に示します。
PATCH https://graph.microsoft.com/v1.0/teamwork/workforceIntegrations/{workforceIntegrationid}
{
"displayName": "ABCWorkforceIntegration",
"apiVersion": 1,
"isActive": true,
"encryption": {
- "protocol": "sharedSecret",
"secret": "My Secret"
},
"url": "https://abcWorkforceIntegration.com/Contoso/",
"supports": "Shift,SwapRequest",
"eligibilityFilteringEnabledEntities": "SwapRequest"
}
応答
応答の例を次に示します。
HTTP/1.1 200 OK
Content-type: application/json
{
"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"
}
SwapRequest が適格性フィルターに対して有効になっている新しい workforceintegration を作成する方法については、「Create」を 参照してください。
SwapRequest が eligibilityFilteringEnabledEntities に含まれている場合の適格シフトのフェッチの例
Shifts アプリとワークフォース統合エンドポイントの間の相互作用は、既存のパターンに従います。
要求
以下は、スワップ要求の適格なシフトをフェッチするために Shifts が workforce 統合エンドポイントに対して行った要求の例です。
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}”
}]
}
応答
従業員統合サービスからの応答の例を次に示します。
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
}
]
}