从DataSource修补或删除重量 - 删除其他应用

时间:2016-05-26 14:24:33

标签: google-api google-fit

我尝试使用google fitness 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提取工作正常并返回

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

这是什么问题?我是否需要设置某种特殊访问权限?

1 个答案:

答案 0 :(得分:2)

根据适合的API设计,

  

应用无法删除其他应用插入的数据。

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