Patch or Delete Weight from DataSource - 删除其他应用程序插入的数据

Patch or Delete Weight from DataSource - delete data inserted by other apps

我正在尝试使用 google 适应性 api 从数据源中修补或删除权重 api。

developers.google.com/oauthplayground 上,developers.google.com/apis-explorer 和我使用 GET https://www.googleapis.com/fitness/v1/users/me/dataSources/raw%3Acom.google.weight%3Acom.google.android.apps.fitness%3Auser_input/datasets/1438146389462000000-1438146389462000000 获取的本地客户端工作正常并且 returns

{
  "minStartTimeNs": "1438146389462000000", 
  "maxEndTimeNs": "1438146389462000000", 
  "dataSourceId": "raw:com.google.weight:com.google.android.apps.fitness:user_input", 
  "point": [
    {
      "startTimeNanos": "1438146389462000000", 
      "modifiedTimeMillis": "1438147314620", 
      "endTimeNanos": "1438146389462000000", 
      "value": [
        {
          "fpVal": 132.04063415527344
        }
      ], 
      "dataTypeName": "com.google.weight"
    }
  ]
}

但是当我尝试发送 DELETE 请求时,我得到以下信息:


{
  "error": {
    "code": 403, 
    "message": "Application package name (com.google.android.apps.fitness) provided by un-trusted source.", 
    "errors": [
      {
        "domain": "global", 
        "message": "Application package name (com.google.android.apps.fitness) provided by un-trusted source.", 
        "reason": "forbidden"
      }
    ]
  }
}

这里有什么问题?我需要设置某种特殊访问权限吗?

根据适合API设计,

An app cannot delete data inserted by other apps.

如果是这种情况,将导致权限问题 - 禁止访问。