Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.


Get user's friends in the format requested using units in the unit system which corresponds to the Accept-Language header provided.

Access Type: Read

Rate Limited: Yes

...

  • response will include the correct values for accessible fields and empty values otherwise:
    empty string, "NA" (empty gender), 0 (empty height), default avatar etc., some values revealed to authorized user only,
  • About Me controls aboutMe, gender, avatar,
  • Age and height controls dateOfBirth, height,
  • Location controls country, city, state, timezone, offsetFromUTCMillis,
  • Weight & BMI controls weight.

...

GET /<api-version>/user/<user-id>/friends.<response-format>

api-version

The API version. Currently 1.

user-id

User's encoded id or "-" (dash) to indicate user currently authenticated via the token credentials provided.

response-format

The response format. Currently supported response formats are json and xml for responses in JSON and XML, respectively.

Code Block
bgColor#eeeeee
titleBGColor#3ec1c1
borderStylesolid
titleExamples

GET /1/user/228TQ4/friends.json
GET /1/user/228TQ4/friends.xml
GET /1/user/-/friends.json
GET /1/user/-/friends.xml

...

Request Headers

Accept-Language

optional

The measurement unit system to use for response values.

Response

API Response in format requested: JSON or XML.

...

Code Block
bgColor#eeeeee
titleBGColor#3ec1c1
borderStylesolid
titleJSON Response

{
    "friends":[
        {
            "user":
                {
                    "aboutMe":<value>,
                    "avatar":<value>,
                    "city":<value>,
                    "country":<value>,
                    "dateOfBirth":<value>,
                    "displayName":<value>,
                    "encodedId":<value>,
                    "fullName":<value>,
                    "gender":<FEMALE|MALE|NA>,
                    "height":<value>,
                    "nickname":<value>,
                    "offsetFromUTCMillis":<value>,
                    "state":<value>,
                    "strideLengthRunning":<value>,
                    "strideLengthWalking":<value>,
                    "timezone":<value>,
                    "weight":<value>
                }
         },
         <...>
     ]
}

...

Code Block
bgColor#eeeeee
titleBGColor#3ec1c1
borderStylesolid
titleXML Response

<?xml version="1.0" encoding="UTF-8"?>
<result>
    <friends>
        <friend>
            <user>
                <aboutMe>[value]</aboutMe>
                <avatar>[value]</avatar>
                <city>[value]</city>
                <country>[value]</country>
                <dateOfBirth>[value]</dateOfBirth>
                <displayName>[value]</displayName>
                <encodedId>[value]</encodedId>
                <fullName>[value]</fullName>
                <gender>[FEMALE|MALE|NA]</gender>
                <height>[value]</height>
                <nickname>[value]</nickname>
                <offsetFromUTCMillis>[value]</offsetFromUTCMillis>
                <state>[value]</state>
                <strideLengthRunning>[value]</strideLengthRunning>
                <strideLengthWalking>[value]</strideLengthWalking>
                <timezone>[value]</timezone>
                <weight>[value]</weight>
            </user>
        </friend>
        [...]
    </friends>
</result>

 

Examples

Code Block
bgColor#eeeeee
titleBGColor#3ec1c1
borderStylesolid
titleJSON Response

{
    "friends":[
        {
            "user":
                {
                    "aboutMe":"I live in San Francisco.",
                    "avatar":"http://www.fitbit.com/images/profile/defaultProfile_100_male.gif",
                    "city":"San Francisco",
                    "country":"US",
                    "dateOfBirth":"1970-02-18",
                    "displayName":"Nick",
                    "encodedId":"257V3V",
                    "fullName":"Fitbit",
                    "gender":"MALE",
                    "height":176.7,
                    "nickname":"Nick",
                    "offsetFromUTCMillis":25200000,
                    "state":"CA",
                    "strideLengthRunning":0,
                    "strideLengthWalking":0,
                    "timezone":"America/Los_Angeles",
                    "weight":80.5
                }
         },
         {
            "user":
                {
                    "aboutMe":"", 
                    "avatar":"http://www.fitbit.com/images/profile/defaultProfile_100_male.gif",
                    "city":"",
                    "country":"",
                    "dateOfBirth":"",
                    "displayName":"Fitbit U.",
                    "encodedId":"2246K9",
                    "fullName":"Fitbit User",
                    "gender":"NA",
                    "height":190.7,
                    "nickname":"",
                    "offsetFromUTCMillis":14400000,
                    "state":"",
                    "strideLengthRunning":0,
                    "strideLengthWalking":0,
                    "timezone":"Europe/Moscow",
                    "weight":0
                }
         }
     ]
}
Code Block
bgColor#eeeeee
titleBGColor#3ec1c1
borderStylesolid
titleXML Response

<?xml version="1.0" encoding="UTF-8"?>
<result>
    <friends>
        <friend>
            <user>
                <aboutMe>I live in San Francisco.</aboutMe>
                <avatar>http://www.fitbit.com/images/profile/defaultProfile_100_male.gif</avatar>
                <city>San Francisco</city>
                <country>US</country>
                <dateOfBirth>1971-02-18</dateOfBirth>
                <displayName>Nick</displayName>
                <encodedId>2295YW</encodedId>
                <fullName>Fitbit</fullName>
                <gender>MALE</gender>
                <height>176.7</height>
                <nickname>Nick</nickname>
                <offsetFromUTCMillis>-25200000</offsetFromUTCMillis>
                <state>CA</state>
                <strideLengthRunning>0</strideLengthRunning>
                <strideLengthWalking>0</strideLengthWalking>
                <timezone>America/Los_Angeles</timezone>
                <weight>80.5</weight>
            </user>
        </friend>
        <friend>
            <user>
                <aboutMe/>
                <avatar>http://www.fitbit.com/images/profile/defaultProfile_100_male.gif</avatar>
                <city/>
                <country/>
                <dateOfBirth/>
                <displayName>Fitbit U.</displayName>
                <encodedId>2246K9</encodedId>
                <fullName>Fitbit User</fullName>
                <gender>NA</gender>
                <height>190.7</height>
                <nickname/>
                <offsetFromUTCMillis>14400000</offsetFromUTCMillis>
                <state/>
                <strideLengthRunning>0</strideLengthRunning>
                <strideLengthWalking>0</strideLengthWalking>
                <timezone>Europe/Moscow</timezone>
                <weight>0</weight>
            </user>
        </friend>
    </friends>
</result>