User

Retrieve and update User information

Resource URIs

Collection URI: /api/0.2/user/

Item URI: /api/0.2/user/<pk>/

Item

Item methods

GET Get User information. The current authenticated User can be retrieved by accessing /user/self/ PUT Update User information

Item query parameters

Item properties

Name Description Type HTTP Support
date_joined The date/time that the User joined. DateTime GET:Required, POST:Optional, PUT::Optional
first_name The User’s first name. string GET:Required, POST:Required, PUT::Optional
gender The User’s gender ‘M’ or ‘F’ GET:Required, POST:Required, PUT::Optional
last_initial The first character of the User’s last name. string GET:Required, POST:Optional, PUT::Optional
last_login The date/time that the User last logged in. DateTime GET:Required, POST:Optional, PUT::Optional
location The User’s location. string GET:Required, POST:Optional, PUT::Optional
locality The User’s locality (typically represents city). string GET:Required, POST:Optional, PUT::Optional
region The User’s region (represents state in US, province in Canada). Refer to ISO-3166-2. string GET:Required, POST:Optioanl, PUT::Optional
country The User’s country. Refer to ISO-3166-1 Alpha 2 string GET:Required, POST:Optional, PUT::Optional
time_zone The User’s time zone (ex. America/Denver or MST). Refer to the IANA Time Zone Database. string GET:Required, POST:Optional, PUT::Optional
username The User’s username. string GET:Required, POST:Required, PUT::Optional
preferred_language The User’s preferred language. Use the two-letter ISO-639-1 standard for the language code (see a list).
Some language identifiers contain a suffix with an ISO-3166-1 Alpha 2 region code.
We currently support es, fr, de, pt, ne, it, ja-JP, zh-CN, and en-US. Defaults to en-US.
string GET:Required, POST:Optional, PUT::Optional
Additional properties available when requesting the authenticated User
Name Description Type Units HTTP Support
birthdate The User’s date of birth type   GET:authed User only, POST:Required, PUT:Optional
email The User’s email address type   GET:authed User only, POST:Required, PUT:Optional
communication The User’s communication preferences type   GET:authed User only, POST:Optional, PUT:Optional
newsletter Indicates the User’s desire to receive email newsletters type   GET:authed User only, POST:Optional, PUT:Optional
promotions Indicates the User’s desire to receive email promotions type   GET:authed User only, POST:Optional, PUT:Optional
system_messages Indicates the User’s desire to receive system message emails type   GET:authed User only, POST:Optional, PUT:Optional
display_measurement_system The User’s measurement system preference (for display purposes when using Under Armour sites and apps) Valid values: “imperial” (lb/miles), “metric” (kg/km), “hybrid” (lbs/km) type   GET:authed User only, POST:Optional, PUT:Optional
last_name The User’s last name type   GET:authed User only, POST:Required, PUT:Optional
location The User’s location. type   GET:authed User only, POST:Optional, PUT:Optional
address The User’s address (includes street address and apt/unit information). type   GET:authed User only, POST:Optional, PUT:Optional
sharing The User’s default sharing preferences type   GET:authed User only, POST:Optional, PUT:Optional
facebook Indicates the User’s desire to share workouts on Facebook by default type   GET:authed User only, POST:Optional, PUT:Optional
twitter Indicates the User’s desire to share workouts on Twitter by default type   GET:authed User only, POST:Optional, PUT:Optional
height The User’s height type meters GET:authed User only, POST:Optional, PUT:Optional
weight The User’s weight type kilograms GET:authed User only, POST:Optional, PUT:Optional

Note: Setting a sharing setting to True will only apply if the User’s account is connected to the respective social media platform. Otherwise PUT will be ignored.

Additional properties available when viewing Users that are friends with the authenticated User
Name Description Type Units HTTP Support
goal_statement The User’s personal statement string   GET:authed User and friends
hobbies The User’s hobbies/interests string   GET:authed User and friends
introduction The User’s introduction statement string   GET:authed User and friends
last_name The User’s last name string   GET:authed User and friends
Link Required Description
deactivation Yes Read-Only Link to User deactivation
friendships Yes Read-Only Link to the User’s friendships
image Yes Read-Only Link to the User’s image (profile photo)
privacy Yes The User’s privacy settings
privacy.profile Yes The privacy of the User’s profile
privacy.route Yes The default privacy of routes created by the User
privacy.food_log Yes The default privacy of the User’s food log
privacy.workout Yes The default privacy of workouts logged/recorded by the User
privacy.bodymass Yes The default privacy of the User’s bodymass
privacy.sleep Yes The default privacy of the User’s sleep
privacy.workout_music Yes The default privacy of the User’s workout_music
privacy.email_search Yes The privacy of the User’s email address for allowing their account to be discovered by email address. Limited to public and private. If a value other than public (3) is passed on a POST or PUT, value will be set to private (0)
stats Yes Read-Only The User’s aggregated workout statistcs
stats.day Yes Read-Only Link to the User’s stats aggregated by for day
stats.week Yes Read-Only Link to the User’s stats aggregated by for week
stats.month Yes Read-Only Link to the User’s stats aggregated by for month
stats.year Yes Read-Only Link to the User’s stats aggregated by for year
stats.lifetime Yes Read-Only Link to the User’s stats aggregated by for lifetime
user_achievements Yes Read-Only Link to the User’s achievements
workouts Yes Read-Only Link to the User’s workouts sorted by most recent

Collection

Collection methods

GET Retrieve a collection of Users. Must be used with one of friends_with or suggested_friends_for.

Collection query parameters

Name Description Type Required
friends_with Retrieve the Users that the specified User is friends with. If the User requested is the authenticated User, all friends will be returned. If the User requested is not the authenticated User, the User’s friends privacy setting and the friendship list of the current User will be used to determine which friends are returned. User id/href No
mutual_friends_for A comma-delimited set of User ids to retrieve mutual friend relationships for. User id/href No
requested_friendship_with Provides a collection of the Users requesting friendship with a User. User id/href No
suggested_friends_emails To be used with suggested_friends_for. Provides a collection of suggested Under Armour Users based on a list of email addresses. Email address should be provided as a comma-delimited list. list No
suggested_friends_for A filter for retrieving suggested friends for the authenticated User. Must be used with one of suggested_friends_source or suggested_friends_emails. User id/href No
suggested_friends_source To be used with suggested_friends_for. Provides a collection of suggested Under Armour Users for the authenticated User from an external friendship source. Valid sources: facebook, mmf facebook or mmf No
q Search for Users by query. If the query looks like an email, an email search will be performed string No
email Search for Users by email address. string No
name Search for Users by name. string No
username Search for Users by username. string No

Collection properties

Name Type Units Description HTTP Support
total_count int   The total number of Users matching the query parameters specified Required

Usage

Retrieve a User by username

GET User entity by ID

Request GET: /api/0.2/user/{pk}/
Response
{
    "last_name": "Last",
    "weight": null,
    "communication": {
        "promotions": true,
        "newsletter": true,
        "system_messages": true
    },
    "height": null,
    "hobbies": "",
    "id": {User ID},
    "date_joined": "2014-08-28T00:33:20+00:00",
    "first_name": "First",
    "display_name": "First Last",
    "introduction": "",
    "display_measurement_system": "imperial",
    "last_login": "2014-08-28T00:33:20+00:00",
    "goal_statement": null,
    "_links": {
        "stats": [{
            "href": "\/api/0.2\/user_stats\/{User ID}\/?aggregate_by_period=month",
            "id": "{User ID}",
            "name": "month"
        }, {
            "href": "\/api/0.2\/user_stats\/{User ID}\/?aggregate_by_period=year",
            "id": "{User ID}",
            "name": "year"
        }, {
            "href": "\/api/0.2\/user_stats\/{User ID}\/?aggregate_by_period=day",
            "id": "{User ID}",
            "name": "day"
        }, {
            "href": "\/api/0.2\/user_stats\/{User ID}\/?aggregate_by_period=week",
            "id": "{User ID}",
            "name": "week"
        }, {
            "href": "\/api/0.2\/user_stats\/{User ID}\/?aggregate_by_period=lifetime",
            "id": "{User ID}",
            "name": "lifetime"
        }],
        "privacy": [{
            "href": "\/api/0.2\/privacy_option\/1\/",
            "id": "1",
            "name": "profile"
        }, {
            "href": "\/api/0.2\/privacy_option\/1\/",
            "id": "1",
            "name": "workout"
        }, {
            "href": "\/api/0.2\/privacy_option\/0\/",
            "id": "0",
            "name": "bodymass"
        }, {
            "href": "\/api/0.2\/privacy_option\/1\/",
            "id": "1",
            "name": "food_log"
        }, {
            "href": "\/api/0.2\/privacy_option\/3\/",
            "id": "3",
            "name": "email_search"
        }, {
            "href": "\/api/0.2\/privacy_option\/1\/",
            "id": "1",
            "name": "route"
        }, {
            "href": "\/api/0.2\/privacy_option\/0\/",
            "id": "0",
            "name": "sleep"
        }],
        "image": [{
            "href": "\/api/0.2\/user_profile_photo\/{User ID}\/",
            "id": "{User ID}",
            "name": "user_profile_photo"
        }],
        "documentation": [{
            "href": "https:\/\/developer.underarmour.com\/docs\/02_User/"
        }],
        "deactivation": [{
            "href": "\/api/0.2\/user_deactivation\/"
        }],
        "user_achievements": [{
            "href": "\/api/0.2\/user_achievement\/?user={User ID}"
        }],
        "friendships": [{
            "href": "\/api/0.2\/friendship\/?from_user={User ID}"
        }],
        "workouts": [{
            "href": "\/api/0.2\/workout\/?user={User ID}&order_by=-start_datetime"
        }],
        "self": [{
            "href": "\/api/0.2\/user\/{User ID}\/",
            "id": "{User ID}"
        }]
    },
    "email": "the@email.com",
    "location": {
        "country": "US",
        "region": "CO",
        "locality": "Austin",
        "address": ""
    },
    "username": "First{User ID}",
    "sharing": {
        "twitter": false,
        "facebook": false
    },
    "last_initial": "A",
    "gender": "M",
    "time_zone": "America\/Austin",
    "birthdate": "1983-05-05",
    "profile_statement": "",
    "preferred_language": "en-US"
}

GET User entity of current authenticated User

Request GET: /api/0.2/user/self/
Response
{
    "last_name": "Last",
    "weight": null,
    "communication": {
        "promotions": true,
        "newsletter": true,
        "system_messages": true
    },
    "height": null,
    "hobbies": "",
    "id": {user ID},
    "date_joined": "2014-08-28T00:33:20+00:00",
    "first_name": "First",
    "display_name": "First Last",
    "introduction": "",
    "display_measurement_system": "imperial",
    "last_login": "2014-08-28T00:33:20+00:00",
    "goal_statement": null,
    "_links": {
        "stats": [{
            "href": "\/api/0.2\/user_stats\/{user ID}\/?aggregate_by_period=month",
            "id": "{user ID}",
            "name": "month"
        }, {
            "href": "\/api/0.2\/user_stats\/{user ID}\/?aggregate_by_period=year",
            "id": "{user ID}",
            "name": "year"
        }, {
            "href": "\/api/0.2\/user_stats\/{user ID}\/?aggregate_by_period=day",
            "id": "{user ID}",
            "name": "day"
        }, {
            "href": "\/api/0.2\/user_stats\/{user ID}\/?aggregate_by_period=week",
            "id": "{user ID}",
            "name": "week"
        }, {
            "href": "\/api/0.2\/user_stats\/{user ID}\/?aggregate_by_period=lifetime",
            "id": "{user ID}",
            "name": "lifetime"
        }],
        "privacy": [{
            "href": "\/api/0.2\/privacy_option\/1\/",
            "id": "1",
            "name": "profile"
        }, {
            "href": "\/api/0.2\/privacy_option\/1\/",
            "id": "1",
            "name": "workout"
        }, {
            "href": "\/api/0.2\/privacy_option\/0\/",
            "id": "0",
            "name": "bodymass"
        }, {
            "href": "\/api/0.2\/privacy_option\/1\/",
            "id": "1",
            "name": "food_log"
        }, {
            "href": "\/api/0.2\/privacy_option\/3\/",
            "id": "3",
            "name": "email_search"
        }, {
            "href": "\/api/0.2\/privacy_option\/1\/",
            "id": "1",
            "name": "route"
        }, {
            "href": "\/api/0.2\/privacy_option\/0\/",
            "id": "0",
            "name": "sleep"
        }, {
            "href": "\/api/0.2\/privacy_option\/0\/",
            "id": "0",
            "name": "workout_music"
        }],
        "image": [{
            "href": "\/api/0.2\/user_profile_photo\/{user ID}\/",
            "id": "{user ID}",
            "name": "user_profile_photo"
        }],
        "documentation": [{
            "href": "https:\/\/developer.underarmour.com\/docs\/02_User/"
        }],
        "deactivation": [{
            "href": "\/api/0.2\/user_deactivation\/"
        }],
        "user_achievements": [{
            "href": "\/api/0.2\/user_achievement\/?user={user ID}"
        }],
        "friendships": [{
            "href": "\/api/0.2\/friendship\/?from_user={user ID}"
        }],
        "workouts": [{
            "href": "\/api/0.2\/workout\/?user={user ID}&order_by=-start_datetime"
        }],
        "self": [{
            "href": "\/api/0.2\/user\/`{user ID}\/",
            "id": "{user ID}"
        }]
    },
    "email": "email@emaildomain.com",
    "location": {
        "country": "US",
        "region": "CO",
        "locality": "Austin",
        "address": ""
    },
    "username": "First{user ID}",
    "sharing": {
        "twitter": false,
        "facebook": false
    },
    "last_initial": "A.",
    "gender": "M",
    "time_zone": "America\/Austin",
    "birthdate": "1983-05-05",
    "profile_statement": "",
    "preferred_language": "en-US"
}

PUT User entity

Request PUT: /api/0.2/user/{pk}/
{
    "weight": 200,
}
Response
{
    "last_name": "Last",
    "weight": 200.03423517,
    "communication": {
        "promotions": true,
        "newsletter": true,
        "system_messages": true
    },
    "height": null,
    "hobbies": "",
    "id": {User ID},
    "date_joined": "2014-08-28T00:33:20+00:00",
    "first_name": "First",
    "display_name": "First Last",
    "introduction": "",
    "display_measurement_system": "imperial",
    "last_login": "2014-08-28T00:33:20+00:00",
    "goal_statement": null,
    "_links": {
        "stats": [{
            "href": "\/api/0.2\/user_stats\/{User ID}\/?aggregate_by_period=month",
            "id": "{User ID}",
            "name": "month"
        }, {
            "href": "\/api/0.2\/user_stats\/{User ID}\/?aggregate_by_period=year",
            "id": "{User ID}",
            "name": "year"
        }, {
            "href": "\/api/0.2\/user_stats\/{User ID}\/?aggregate_by_period=day",
            "id": "{User ID}",
            "name": "day"
        }, {
            "href": "\/api/0.2\/user_stats\/{User ID}\/?aggregate_by_period=week",
            "id": "{User ID}",
            "name": "week"
        }, {
            "href": "\/api/0.2\/user_stats\/{User ID}\/?aggregate_by_period=lifetime",
            "id": "{User ID}",
            "name": "lifetime"
        }],
        "privacy": [{
            "href": "\/api/0.2\/privacy_option\/1\/",
            "id": "1",
            "name": "profile"
        }, {
            "href": "\/api/0.2\/privacy_option\/1\/",
            "id": "1",
            "name": "workout"
        }, {
            "href": "\/api/0.2\/privacy_option\/0\/",
            "id": "0",
            "name": "bodymass"
        }, {
            "href": "\/api/0.2\/privacy_option\/1\/",
            "id": "1",
            "name": "food_log"
        }, {
            "href": "\/api/0.2\/privacy_option\/3\/",
            "id": "3",
            "name": "email_search"
        }, {
            "href": "\/api/0.2\/privacy_option\/1\/",
            "id": "1",
            "name": "route"
        }, {
            "href": "\/api/0.2\/privacy_option\/0\/",
            "id": "0",
            "name": "sleep"
        }, {
            "href": "\/api/0.2\/privacy_option\/0\/",
            "id": "0",
            "name": "workout_music"
        }],
        "image": [{
            "href": "\/api/0.2\/user_profile_photo\/{User ID}\/",
            "id": "{User ID}",
            "name": "user_profile_photo"
        }],
        "documentation": [{
            "href": "https:\/\/developer.underarmour.com\/docs\/02_User/"
        }],
        "deactivation": [{
            "href": "\/api/0.2\/user_deactivation\/"
        }],
        "user_achievements": [{
            "href": "\/api/0.2\/user_achievement\/?user={User ID}"
        }],
        "friendships": [{
            "href": "\/api/0.2\/friendship\/?from_user={User ID}"
        }],
        "workouts": [{
            "href": "\/api/0.2\/workout\/?user={User ID}&order_by=-start_datetime"
        }],
        "self": [{
            "href": "\/api/0.2\/user\/{User ID}\/",
            "id": "{User ID}"
        }]
    },
    "email": "the@email.com",
    "location": {
        "country": "US",
        "region": "CO",
        "locality": "Denver",
        "address": ""
    },
    "username": "First{User ID}",
    "sharing": {
        "twitter": false,
        "facebook": false
    },
    "last_initial": "M.",
    "gender": "M",
    "time_zone": "America\/Denver",
    "birthdate": "1983-05-05",
    "profile_statement": "",
    "preferred_language": "en-US"
}

GET User collection

Request GET: /api/0.2/user/
Response
{
    "_links": {
        "self": [{
            "href": "\/api/0.2\/user\/?name=first_name"
        }],
        "documentation": [{
            "href": "https:\/\/developer.underarmour.com\/docs\/02_User/"
        }]
    },
    "_embedded": {
        "routes": [{
         ...
        }],
    "total_count": 1000
}