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"
}

応答

応答の例を次に示します。

注: ここに示す応答オブジェクトは、読みやすさのために短縮されている場合があります。

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
    }
  ]
}