fatsecret Platform API Documentation

Profile - Exercise Diary: Save Template

OAuth 1.0 Latest
Description

Takes the set of exercise entries on a nominated date and saves these entries as "template" entries for nominated days of the week. By default, the template daily exercise entries for all users for all days of the week are:

  • 8 hours of "Sleeping"
  • 16 hours of "Resting"

his method is used to take the saved entries on for a nominated date and to copy them for one or more days of the week as the template daily exercise entries. So, for instance, if a user records 1 hour of walking, 8 hours of sleeping and 15 hours of resting for a particular day in their exercise diary, and then saves that date as a template for Saturday and Sunday, these three activities will be presented as the default exercise entries for all future Saturdays and Sundays.

Parameters
URL / Method
NAME TYPE REQUIRED DESCRIPTION
URL (new)
Method
N/A Required "https://platform.fatsecret.com/rest/exercise-entries/template/v1"
HTTP "POST"
OR
method String Required "exercise_entries.save_template" (included with other parameters)
Additional Parameters
NAME TYPE REQUIRED DESCRIPTION
days Int Required The days of the week specified as bits with Sunday being the 1st bit and Saturday being the last and then converted to an Int. For example Tuesday and Thursday would be represented as 00010100 in bits or 20 in Int where Tuesday is the 3rd bit from the right and Thursday being the 5th. Must be between 0 and 128
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
There are no storable values returned by this call.

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>'
101 Parameter Missing required parameter: '<details>'
107 Parameter Value out of range: '<details>'
204 Application Date selected does not have any activity to default: '<details>'
210 Application User cannot have templates set: '<details>'