01-27-2015 02:19
01-27-2015 02:19
i need to get data from Fitbit API with US unit measure my code has fix value in en_US but i receive Kilogram
it doesn't Pound.
private RestRequest CreateRestRequest(string apiCall, Method method = Method.GET)
{
var request = new RestRequest(apiCall, method);
// Always no cache
request.AddHeader("Cache-Control", "no-cache");
request.AddHeader("Accept-Language", "en_US");
return request;
}is these correct for add information on header ?
ps . My profile changed to 'Pound' when i scale on Aria.
Thank you. 🙂
Answered! Go to the Best Answer.
Best Answer01-27-2015 11:49
Fitbit Developers oversee the SDK and API forums. We're here to answer questions about Fitbit developer tools, assist with projects, and make sure your voice is heard by the development team.
01-27-2015 11:49
What exactAPI endpoint are you calling. I just tested https://api.fitbit.com/1/user/-/body/log/weight/date/<date>.json and it worked for me with Accept-Language: en_US header it responded in pounds.
Best Answer01-27-2015 11:49
Fitbit Developers oversee the SDK and API forums. We're here to answer questions about Fitbit developer tools, assist with projects, and make sure your voice is heard by the development team.
01-27-2015 11:49
What exactAPI endpoint are you calling. I just tested https://api.fitbit.com/1/user/-/body/log/weight/date/<date>.json and it worked for me with Accept-Language: en_US header it responded in pounds.
Best Answer01-27-2015 18:30
01-27-2015 18:30
i called 'API-Get-Time-Series' and respect type '[/body/weight]'.Before i call API i prepare request object like these. (below)
var request = CreateRestRequest(requestUrl);
request.AddHeader("Accept-Language", "en_US");
request.OnBeforeDeserialization = resp =>
{
// Set root element
var data = (JsonObject) SimpleJson.DeserializeObject(resp.Content);
if (data != null && data.Any())
{
var root = data.FirstOrDefault();
request.RootElement = root.Key;
}
};
Best Answer01-27-2015 18:42
01-27-2015 18:42
i found my problem. Thank you for answer 🙂
the problem is 'wrong step of add header'.
Best Answer