次の方法で共有


workforceIntegration を作成する

名前空間: microsoft.graph

新しい workforceIntegration オブジェクトを作成します。

この API は、次の国内クラウド展開で使用できます。

グローバル サービス 米国政府機関 L4 米国政府機関 L5 (DOD) 21Vianet が運営する中国

アクセス許可

この API の最小特権としてマークされているアクセス許可またはアクセス許可を選択します。 アプリで必要な場合にのみ、より高い特権のアクセス許可またはアクセス許可を使用します。 委任されたアクセス許可とアプリケーションのアクセス許可の詳細については、「アクセス許可の種類」を参照してください。 これらのアクセス許可の詳細については、「アクセス許可のリファレンス」を参照してください。

アクセス許可の種類 最小特権アクセス許可 より高い特権のアクセス許可
委任 (職場または学校のアカウント) WorkforceIntegration.ReadWrite.All 注意事項なし。
委任 (個人用 Microsoft アカウント) サポートされていません。 サポートされていません。
アプリケーション WorkforceIntegration.ReadWrite.All 注意事項なし。

: この API は、管理者のアクセス許可をサポートします。 管理者ロールを持つユーザーは、自分がメンバーではないグループにアクセスできます。

HTTP 要求

POST /teamwork/workforceIntegrations

要求ヘッダー

名前 説明
Authorization ベアラー {token}。 必須です。 認証と認可についての詳細をご覧ください。
Content-type application/json. Required.
MS-APP-ACTS-AS ユーザー ID (GUID)。 承認トークンがアプリケーション トークンの場合にのみ必要です。それ以外の場合は省略可能です。

要求本文

要求本文で、 workforceIntegration オブジェクトの JSON 表現を指定します。

次の表に、 workforceIntegration オブジェクトを作成するときに使用できるプロパティの一覧を示します。

プロパティ 説明
apiVersion Int32 コールバック URL の API バージョン。 1 から始めます。
displayName String 従業員統合の名前。
eligibilityFilteringEnabledEntities eligibilityFilteringEnabledEntities 適格性でフィルター処理された結果を表示するためのサポート。 可能な値は、noneswapRequestofferShiftRequestunknownFutureValuetimeOffReason です。 Prefer: include-unknown-enum-members要求ヘッダーを使用して、この進化可能な列挙型で次の値を取得します:timeOffReason
暗号化 workforceIntegrationEncryption 従業員統合暗号化リソース。
isActive ブール型 この従業員の統合が現在アクティブで使用可能かどうかを示します。
supportedEntities workforceIntegrationSupportedEntities 同期変更通知でサポートされる Shifts エンティティ。 Shifts は、このプロパティで指定されたエンティティに対してクライアントの変更が発生したときに、指定された URL を呼び出します。 既定では、変更通知ではエンティティはサポートされません。 可能な値は、noneshiftswapRequestuserShiftPreferencesopenShiftopenShiftRequestofferShiftRequestunknownFutureValuetimeCardtimeOffReasontimeOfftimeOffRequest です。 Prefer: include-unknown-enum-members要求ヘッダーを使用して、この進化可能な列挙型で次の値を取得します。timeCardtimeOffReasontimeOfftimeOffRequest
url String Shifts サービスからのコールバックに使用される従業員統合 URL。

応答

成功した場合、このメソッドは応答コード 201 Created と、応答本文に新しい workforceIntegration オブジェクトを返します。

要求

次の例は要求を示しています。

POST https://graph.microsoft.com/v1.0/teamwork/workforceIntegrations
Content-Type: application/json

{
  "displayName": "ABCWorkforceIntegration",
  "apiVersion": 1,
  "isActive": true,
  "encryption": {
    "protocol": "sharedSecret",
    "secret": "My Secret"
  },
  "url": "https://ABCWorkforceIntegration.com/Contoso/",
  "supportedEntities": "Shift,SwapRequest",
  "eligibilityFilteringEnabledEntities": "SwapRequest"
}

応答

次の例は応答を示しています。

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

HTTP/1.1 201 Created
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/",
  "supportedEntities": "Shift,SwapRequest",
  "eligibilityFilteringEnabledEntities": "SwapRequest"
}

Workforce 管理システム (WFM) ルールによる適格性フィルター処理の WorkforceIntegration エンティティのユース ケースの例

ユース ケース: 適格性フィルター処理で SwapRequest が有効になっている新しい WorkforceIntegration を作成する

要求

次の例は要求を示しています。

POST https://graph.microsoft.com/v1.0/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/",
  "supportedEntities": "Shift,SwapRequest",
  "eligibilityFilteringEnabledEntities": "SwapRequest"
}

応答

次の例は応答を示しています。

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/",
  "supportedEntities": "Shift,SwapRequest",
  "eligibilityFilteringEnabledEntities": "SwapRequest"
}

適格性フィルター処理で SwapRequest が有効になっている既存の workforceIntegration を更新する方法については、「 更新」を参照してください。

SwapRequest が eligibilityFilteringEnabledEntities に含まれている場合の適格シフトのフェッチの例

Shifts アプリとワークフォース統合エンドポイントの間の相互作用は、既存のパターンに従います。

要求

この例では、スワップ要求の適格なシフトをフェッチするために、従業員統合エンドポイントへのシフトによって行われた要求を示します。

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": [
    "id": "{shiftId}",
    "status: 200,
    "body": {
       "data": [{shiftId}, {shiftId}...]
       "error": null
    }
  ]
}