fatsecret Platform API Documentation
Profile - Exercise Diary: Commit Day
Description
Saves the default exercise entries for the user on a nominated date.
The API will always return 24 hours worth of exercise entries for a given user on a given date. Users can set up and save standard routines for the activities they do on any given day of the week, known as "template" exercise entries. When the exercise entries are retrieved for a day that has not previously been committed or adjusted by the user a set of 24 hours worth of "template" or default entries will be returned.
The exercise_entries.commit_day method takes the current "template" exercise entries and saves them to the exercise diary. Calling this method is in effect an acknowledgement on behalf of a user that they undertook the activities presented in the template.
Parameters
URL / Method
NAME | TYPE | REQUIRED | DESCRIPTION |
---|---|---|---|
URL (new) Method |
N/A | Required | "https://platform.fatsecret.com/rest/exercise-entries/day/v1" HTTP "POST" |
OR | |||
method | String | Required | "exercise_entries.commit_day" (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 success
element contains information as follows:
NAME | TYPE | DESCRIPTION |
---|---|---|
success | Int | Whether the call succeeded or not. If successful equals 1 |
Example Response
Example 1:
<?xml version="1.0" encoding="utf-8"?>
<success 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">1</success>
Example 1:
{
"success": {
"value": "1"
}
}
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>' |