timeCard を作成する

名前空間: microsoft.graph

重要

Microsoft Graph の /beta バージョンの API は変更される可能性があります。 実稼働アプリケーションでこれらの API を使用することは、サポートされていません。 v1.0 で API を使用できるかどうかを確認するには、Version セレクターを使用します。

スケジュールで timeCard インスタンスを作成 します

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

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

アクセス許可

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

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

重要

Schedule.ReadWrite.All アプリケーションのアクセス許可を使用する場合は、要求にヘッダーを MS-APP-ACTS-AS 含める必要があります。

HTTP 要求

POST /teams/{teamId}/schedule/timeCards

要求ヘッダー

ヘッダー
Authorization ベアラー {token}。 必須です。 認証と承認の詳細については、こちらをご覧ください。
Content-type application/json. Required.
MS-APP-ACTS-AS アプリが動作しているユーザーの代理の ID。 アプリケーションのアクセス許可スコープを使用する場合は必須です。

要求本文

このメソッドの要求本文に新しい timeCard オブジェクトを指定します。

応答

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

要求

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

POST https://graph.microsoft.com/beta/teams/871dbd5c-3a6a-4392-bfe1-042452793a50/schedule/timeCards
Content-type: application/json

{
  "onBehalfOfUserId":"a3601044-a1b5-438e-b742-f78d01d68a67",
  "clockInEvent":{
     "dateTime":"2019-03-18T00:00:00.000Z",
     "atApprovedLocation":true,
     "notes": {
        "content": "Started late due to traffic in CA 237",
        "contentType": "text"
     },
  },
  "notes":{
        "content": "8 To 5 Inventory management",
        "contentType": "text"
   },
  "breaks":[
     {
       "breakId": "string",
        "notes":{
             "content": "Lunch break",
             "contentType": "text"
        },
        "start":{
           "dateTime":"2019-03-18T02:00:00.000Z",
           "atApprovedLocation":true,
           "notes": {
                "content": "Reduced break to make up for lost time",
                "contentType": "text"
             },
        }
     }
  ]
}

応答

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

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

HTTP/1.1 201 Created
Content-type: application/json

{
  "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",
  "confirmationStatus": "notConfirmed",
  "originalEntry": {
    "clockInEvent": {
      "dateTime": "2019-03-18T00:00:00.000Z",
      "atApprovedLocation": true,
      "notes": {
        "content": "Started late due to traffic in CA 237",
        "contentType": "text"
      }
    },
    "clockOutEvent": null,
    "breaks": [
      {
        "breakId": "string",
        "notes": {
          "content": "Lunch break",
          "contentType": "text"
        },
        "start": {
          "dateTime": "2019-03-18T02:00:00.000Z",
          "atApprovedLocation": true,
          "notes": {
            "content": "Reduced break to make up for lost time",
            "contentType": "text"
          }
        },
        "end": null
      }
    ]
  },
  "clockInEvent": {
    "dateTime": "2019-03-18T00:00:00.000Z",
    "atApprovedLocation": true,
    "notes": {
      "content": "Started late due to traffic in CA 237",
      "contentType": "text"
    }
  },
  "clockOutEvent": null,
  "notes": {
    "content": "8 To 5 Inventory management",
    "contentType": "text"
  },
  "breaks": [
    {
      "breakId": "string",
      "notes": {
        "content": "Lunch break",
        "contentType": "text"
      },
      "start": {
        "dateTime": "2019-03-18T02:00:00.000Z",
        "atApprovedLocation": true,
        "notes": {
          "content": "Reduced break to make up for lost time",
          "contentType": "text"
        }
      },
      "end": null
    }
  ]
}