profile.create

Description

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 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.

Parameters

Required

Name Type Description
oauth_consumer_key String Your API key when you registered as a developer
oauth_signature_method String The method used to generate the signature (only HMAC-SHA1 is supported)
oauth_timestamp Int The date and time, expressed in the number of seconds since January 1, 1970 00:00:00 GMT. The timestamp value must be a positive integer and must be equal or greater than the timestamp used in previous requests
oauth_nonce String A randomly generated string for a request that can be combined with the timestamp to produce a unique value
oauth_version String MUST be "1.0"
oauth_signature String The signature, a consistent reproducible concatenation of the request elements into a single string. The string is used as an input in hashing or signing algorithms.
method String MUST be "profile.create"

Optional

Name Type Description
format String The desired response format. Valid reponse formats are "xml" or "json" (default value is "xml").
user_id String You can set your own ID for the newly created profile if you do not wish to store the auth_token and auth_secret. Particularly useful if you are only using the FatSecret JavaScript API. Use profile.get_auth to retrieve auth_token and auth_secret.

Response

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.

Example Return XML

<?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">
    <auth_token>639aa3c886b849d2811c09bb640ec2b3</auth_token>
    <auth_secret>cadff7ef247744b4bff48fb2489451fc</auth_secret>
</profile>

Example Return JSON

{ "profile": {"auth_secret": "cadff7ef247744b4bff48fb2489451fc", "auth_token": "639aa3c886b849d2811c09bb640ec2b3" }}

Error Code

Code Description
2 Missing required oauth parameter: "<detail>"
3 Unsupported oauth parameter: "<detail>"
4 Invalid signature method: "<detail>"
5 Invalid consumer key: "<detail>"
6 Invalid/expired timestamp: "<detail>"
7 Invalid/used nonce: "<detail>"
8 Invalid signature: "<detail>"
106 Invalid ID: "<detail>"
FatSecret Sites
For Developers

For Professionals

For Everyone

FatSecret Platform API

Support
API

About FatSecret

© 2022 FatSecret. All rights reserved.