workforceIntegration を作成する
-
[アーティクル]
-
-
名前空間: microsoft.graph
新しい workforceIntegration オブジェクトを作成 します。
Shifts 同期変更通知を受信するエンティティをセットアップし、エンティティを設定して、スワップ要求を含む WFM ルールの適格性によるフィルター処理を構成できます。
アクセス許可
この API を呼び出すには、次のいずれかのアクセス許可が必要です。アクセス許可の選択方法などの詳細については、「アクセス許可」を参照してください。
| アクセス許可の種類 |
アクセス許可 (特権の小さいものから大きいものへ) |
| 委任 (職場または学校のアカウント) |
WorkforceIntegration.ReadWrite.All |
| 委任 (個人用 Microsoft アカウント) |
サポートされていません。 |
| アプリケーション |
サポートされていません。 |
注: この API は、管理者のアクセス許可をサポートします。 グローバル管理者は、メンバーではないグループにアクセスできます。
HTTP 要求
POST /teamwork/workforceIntegrations
| 名前 |
説明 |
| Authorization |
ベアラー {token}。必須。 |
| Content-type |
application/json. Required. |
要求本文
要求本文で、workforceIntegration オブジェクトの JSON 表記を指定 します。
応答
成功した場合、このメソッドは応答コードと、応答本文の新しい 201 Created workforceIntegration オブジェクトを返します。
例
要求
要求の例を次に示します。
POST https://graph.microsoft.com/v1.0/teamwork/workforceIntegrations
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
.Request()
.AddAsync(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')
.post(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"]]];
[urlRequest setHTTPMethod:@"POST"];
[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()
.buildRequest()
.post(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)
result, err := graphClient.Teamwork().WorkforceIntegrations().Post(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"
}
New-MgTeamworkWorkforceIntegration -BodyParameter $params
SDK をプロジェクトに追加し、authProvider インスタンスを作成する方法の詳細については、SDK のドキュメントを参照してください。
応答
応答の例を次に示します。
注: ここに示す応答オブジェクトは、読みやすさのために短縮されている場合があります。
HTTP/1.1 201 Created
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 エンティティの使用例
使用例: SwapRequest が適格性フィルターに有効な新しい WorkforceIntegration を作成する
要求
要求の例を次に示します。
POST https://graph.microsoft.com/v1.0/teamwork/workforceIntegrations/
{
"displayName": "ABCWorkforceIntegration",
"apiVersion": 1,
"isActive": true,
"encryption": {
"protocol": "sharedSecret",
"secret": "My Secret"
},
"url": "https://ABCWorkforceIntegration.com/Contoso/",
"supports": "Shift,SwapRequest",
"eligibilityFilteringEnabledEntities": "SwapRequest"
}
Authorization: Bearer {token}
Content-type: application/json
応答
応答の例を次に示します。
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"
}
SwapRequest が適格性フィルターに対して有効になっている既存の workforceintegration を更新する方法については 、「Update」を参照してください。
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
}
]
}