问题描述
我正在尝试通过REST创建温度数据源,并且它不断失败:
Data type does not match well-kNown data type with the same name
我要发送的数据是:
{"application":{...Same as other working samples....},"dataType":{"field":[{"name":"body_temperature","format":"floatPoint"},{"name":"measurement_location","format":"integer","optional":true}],"name":"com.google.body.temperature"},"name":"Temperature Feed","type":"raw","dataStreamId":"raw:com.google.body.temperature:XXX"}
每https://developers.google.com/fit/datatypes/health#body_temperature,我没有看到任何不应该这样做的原因-我在做什么错?温度是否需要特殊许可?
谢谢。
埃里克
解决方法
问题在于,在REST请求中,measurement_location必须为body_temperature_measurement_location。更改后,它现在可以工作。