Users.dataSources.dataPointChanges: list

查詢特定資料來源的使用者資料點變更。立即試用

要求

HTTP 要求

GET https://www.googleapis.com/fitness/v1/users/userId/dataSources/dataSourceId/dataPointChanges

參數

參數名稱 說明
路徑參數
dataSourceId string 建立資料集的資料來源 ID。
userId string 列出已識別身分的資料點。使用 me 表示已驗證的使用者。目前僅支援 me
選用查詢參數
limit integer 如未指定,則回應中不會包含太多本次變更的資料點。
pageToken string 用於瀏覽大型結果集的接續權杖。如要取得下一頁的結果,請將這個參數設為前一個回應的 nextPageToken 值。

授權

此要求需要至少具備下列其中一個範圍的授權:

範圍
https://www.googleapis.com/auth/fitness.activity.read
https://www.googleapis.com/auth/fitness.activity.write
https://www.googleapis.com/auth/fitness.location.read
https://www.googleapis.com/auth/fitness.location.write
https://www.googleapis.com/auth/fitness.body.read
https://www.googleapis.com/auth/fitness.body.write
https://www.googleapis.com/auth/fitness.nutrition.read
https://www.googleapis.com/auth/fitness.nutrition.write
https://www.googleapis.com/auth/fitness.blood_pressure.read
https://www.googleapis.com/auth/fitness.blood_pressure.write
https://www.googleapis.com/auth/fitness.blood_glucose.read
https://www.googleapis.com/auth/fitness.blood_glucose.write
https://www.googleapis.com/auth/fitness.oxygen_saturation.read
https://www.googleapis.com/auth/fitness.oxygen_saturation.write
https://www.googleapis.com/auth/fitness.body_temperature.read
https://www.googleapis.com/auth/fitness.body_temperature.write
https://www.googleapis.com/auth/fitness.reproductive_health.read
https://www.googleapis.com/auth/fitness.reproductive_health.write

詳情請參閱驗證與授權頁面。

要求主體

此方法不會提供要求主體。

回應

如果成功的話,這個方法會傳回回應內文,其結構如下:

{
  "insertedDataPoint": [
    {
      "startTimeNanos": long,
      "endTimeNanos": long,
      "dataTypeName": string,
      "originDataSourceId": string,
      "value": [
        {
          "intVal": integer,
          "fpVal": double,
          "stringVal": string,
          "mapVal": [
            {
              "key": string,
              "value": {
                "fpVal": double
              }
            }
          ]
        }
      ],
      "modifiedTimeMillis": long,
      "rawTimestampNanos": long,
      "computationTimeMillis": long
    }
  ],
  "deletedDataPoint": [
    {
      "startTimeNanos": long,
      "endTimeNanos": long,
      "dataTypeName": string,
      "originDataSourceId": string,
      "value": [
        {
          "intVal": integer,
          "fpVal": double,
          "stringVal": string,
          "mapVal": [
            {
              "key": string,
              "value": {
                "fpVal": double
              }
            }
          ]
        }
      ],
      "modifiedTimeMillis": long,
      "rawTimestampNanos": long,
      "computationTimeMillis": long
    }
  ],
  "nextPageToken": string,
  "dataSourceId": string
}
屬性名稱 說明 附註
insertedDataPoint[] list 已為使用者插入資料點。
insertedDataPoint[].startTimeNanos long 這個資料點代表的時間間隔開始時間 (以 Epoch 紀元時間算起)。
insertedDataPoint[].endTimeNanos long 這個資料點代表的時間間隔結束時間 (以自 Epoch 紀元時間算起)。
insertedDataPoint[].dataTypeName string 定義這個資料點值格式的資料類型。
insertedDataPoint[].originDataSourceId string 如果資料點衍生自衍生資料來源的資料集,系統會在這個欄位填入最初建立資料點的資料來源 ID。

警告:除了偵錯以外,請勿將這個欄位用於其他用途。這個欄位的值 (如果已設定) 是導入詳細資料,不保證會維持不變。
insertedDataPoint[].value[] list 資料點的每個資料類型欄位的值。在相應的資料類型中,預期資料值會依指定資料來源中所列資料類型的順序排列。

系統只會根據資料來源和類型欄位的格式列舉值,填入一個整數和浮點欄位。

insertedDataPoint[].value[].intVal integer 整數值。設定這個值後,不得設定其他值。
insertedDataPoint[].value[].fpVal double 浮點值。設定這個值後,不得設定其他值。
insertedDataPoint[].value[].stringVal string 字串值。設定這個值後,不得設定其他值。字串應盡可能精簡。如果字串值較大,但資料頻率較高,系統可能會對其進行取樣。
insertedDataPoint[].value[].mapVal[] list 地圖值。每個項目對應值的有效鍵空間和單位應記錄在資料類型定義中。請盡量保持精簡的金鑰。如果資料串流的金鑰較大且資料頻率偏高,系統可能會進行取樣。
insertedDataPoint[].value[].mapVal[].key string
insertedDataPoint[].value[].mapVal[].value nested object
insertedDataPoint[].value[].mapVal[].value.fpVal double 浮點值。
insertedDataPoint[].modifiedTimeMillis long 指出這個資料點上次修改的時間。僅用於列出資料變更 (而非代表目前的資料狀態) 的情況。
insertedDataPoint[].rawTimestampNanos long 原始 SensorEvent 的原始時間戳記。
insertedDataPoint[].computationTimeMillis long 請勿使用這個欄位。系統會忽略這個程式碼,不會儲存。
deletedDataPoint[] list 已刪除使用者的資料點。請注意,在您修改檔案前,請先進行剖析。
deletedDataPoint[].startTimeNanos long 這個資料點代表的時間間隔開始時間 (以 Epoch 紀元時間算起)。
deletedDataPoint[].endTimeNanos long 這個資料點代表的時間間隔結束時間 (以自 Epoch 紀元時間算起)。
deletedDataPoint[].dataTypeName string 定義這個資料點值格式的資料類型。
deletedDataPoint[].originDataSourceId string 如果資料點衍生自衍生資料來源的資料集,系統會在這個欄位填入最初建立資料點的資料來源 ID。

警告:除了偵錯以外,請勿將這個欄位用於其他用途。這個欄位的值 (如果已設定) 是導入詳細資料,不保證會維持不變。
deletedDataPoint[].value[] list 資料點的每個資料類型欄位的值。在相應的資料類型中,預期資料值會依指定資料來源中所列資料類型的順序排列。

系統只會根據資料來源和類型欄位的格式列舉值,填入一個整數和浮點欄位。

deletedDataPoint[].value[].intVal integer 整數值。設定這個值後,不得設定其他值。
deletedDataPoint[].value[].fpVal double 浮點值。設定這個值後,不得設定其他值。
deletedDataPoint[].value[].stringVal string 字串值。設定這個值後,不得設定其他值。字串應盡可能精簡。如果字串值較大,但資料頻率較高,系統可能會對其進行取樣。
deletedDataPoint[].value[].mapVal[] list 地圖值。每個項目對應值的有效鍵空間和單位應記錄在資料類型定義中。請盡量保持精簡的金鑰。如果資料串流的金鑰較大且資料頻率偏高,系統可能會進行取樣。
deletedDataPoint[].value[].mapVal[].key string
deletedDataPoint[].value[].mapVal[].value nested object
deletedDataPoint[].value[].mapVal[].value.fpVal double 浮點值。
deletedDataPoint[].modifiedTimeMillis long 指出這個資料點上次修改的時間。僅用於列出資料變更 (而非代表目前的資料狀態) 的情況。
deletedDataPoint[].rawTimestampNanos long 原始 SensorEvent 的原始時間戳記。
deletedDataPoint[].computationTimeMillis long 請勿使用這個欄位。系統會忽略這個程式碼,不會儲存。
nextPageToken string 用於憑證較大的分頁組合的接續權杖。在後續要求中提供這個值,即可傳回下一頁的結果。
dataSourceId string 包含資料點變更的資料來源的資料串流 ID。

試試看!

使用 APIs Explorer 針對即時資料呼叫這個方法,並查看回應。