FatSecret Platform API Documentation

Profile - Authentication: Create Profile

OAuth 1.0 Latest

Creates a new profile and returns the oauth_token and oauth_secret for the new profile. The token and secret returned by this method are persisted indefinitely and may be used in order to provide profile-specific information storage for users including food and exercise diaries and weight tracking.

The response is a newly allocated oauth_token and associated oauth_secret which should be stored and re-used to provide ongoing API services on behalf of a user.

The results from this call should be saved and subsequently used to provide ongoing storage to users of your site or service. You are obliged to ensure that the values are held securely and to not disclose any oauth_secret values. You should maintain the relationship between your users and the token and secret values you allocate for them.

In addition to creating profiles for your own users, you can also use the full 3-legged OAuth provided by FatSecret.com to attain an access token for a profile that is linked to a user account on FatSecret.com. For more information click here.

method String Required MUST be "profile.create"
user_id String Required You can set your own ID for the newly created profile if you do not wish to store the auth_token and auth_secret
format String Optional The desired response format. Valid response formats are "xml" or "json" (default value is "xml").
The only storable values returned by this call are auth_token and auth_secret.

Each profile element contains information as follows:

auth_token String Oauth key
auth_secret String Oauth secret key

Example Response

Example 1:

<?xml version="1.0" encoding="utf-8"?>
<profile 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">

Example 1:

  "profile": {
    "auth_secret": "cadff7ef247744b4bff48fb2489451fc",
    "auth_token": "639aa3c886b849d2811c09bb640ec2b3"
Error Codes
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>'
106 Parameter Invalid ID: '<details>'