FatSecret Platform API Documentation
Profile - Weight Diary: Get For Month
Description
Returns the recorded weights for a user for the month specified. Use this call to display a user's weight chart or log of weight changes for a nominated month. The day elements returned are those where the user entered or updated their weight for the specified month. Days with no recorded weight are not included.
Why are we introducing this version?
Parameters
URL / Method
NAME | TYPE | REQUIRED | DESCRIPTION |
---|---|---|---|
URL (new) Method |
N/A | Required | "https://platform.fatsecret.com/rest/weight/month/v2" HTTP "GET" |
OR | |||
method | String | Required | "weights.get_month.v2" (included with other parameters) |
Additional Parameters
NAME | TYPE | REQUIRED | DESCRIPTION |
---|---|---|---|
date | Int | Optional | Number of days since January 1, 1970 (default value is the current day) |
format | String | Optional | The desired response format. Valid response formats are "xml" or "json" (default value is "xml"). |
Response
Each month
element contains information as follows:
NAME | TYPE | DESCRIPTION |
---|---|---|
from_date_int | Int | First day expressed as the number of days elapsed since January 1, 1970 |
to_date_int | Int | Last day expressed as the number of days elapsed since January 1, 1970 |
Each day
element contains information as follows:
NAME | TYPE | DESCRIPTION |
---|---|---|
date_int | Int | Date expressed as the number of days elapsed since January 1, 1970 |
weight_kg | Decimal | Recorded weight in kilograms |
weight_comment | String | Comment recorded by the user (where available) |
Example Response
Example 1:
<?xml version="1.0" encoding="utf-8"?>
<month xmlns="http://platform.fatsecret.com/api/1.0/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://platform.fatsecret.com/api/1.0/ http://platform.fatsecret.com/api/1.0/fatsecret.xsd">
<from_date_int>14276</from_date_int>
<to_date_int>14303</to_date_int>
<day>
<date_int>14276</date_int>
<weight_kg>82.000</weight_kg>
<weight_comment>whoo i did it again</weight_comment>
</day>
<day>
<date_int>14282</date_int>
<weight_kg>81.000</weight_kg>
</day>
<day>
<date_int>14288</date_int>
<weight_kg>80.000</weight_kg>
</day>
<day>
<date_int>14294</date_int>
<weight_kg>79.000</weight_kg>
</day>
<day>
<date_int>14303</date_int>
<weight_kg>78.000</weight_kg>
</day>
</month>
Example 1:
{
"month": {
"day": [
{
"date_int": "14276",
"weight_comment": "whoo i did it again",
"weight_kg": "82.000"
},
{
"date_int": "14282",
"weight_kg": "81.000"
},
{
"date_int": "14288",
"weight_kg": "80.000"
},
{
"date_int": "14294",
"weight_kg": "79.000"
},
{
"date_int": "14303",
"weight_kg": "78.000"
}
],
"from_date_int": "14276",
"to_date_int": "14303"
}
}
Error Codes
CODE | TYPE | DESCRIPTION |
---|---|---|
2 | OAuth 1.0 | Missing required oauth parameter: '<details>' |
3 | OAuth 1.0 | Unsupported oauth parameter: '<details>' |
4 | OAuth 1.0 | Invalid signature method: '<details>' |
5 | OAuth 1.0 | Invalid consumer key: '<details>' |
6 | OAuth 1.0 | Invalid/expired timestamp: '<details>' |
7 | OAuth 1.0 | Invalid/used nonce: '<details>' |
8 | OAuth 1.0 | Invalid signature: '<details>' |
9 | OAuth 1.0 | Invalid access token: '<details>' |