User
Retrieve and update User information
Resource URIs
Collection URI: /v7.1/user/
Item URI: /v7.1/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 MapMyFitness 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 |
Item links
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 MapMyFitness 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 MapMyFitness 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: /v7.1/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": "\/v7.1\/user_stats\/{User ID}\/?aggregate_by_period=month",
"id": "{User ID}",
"name": "month"
}, {
"href": "\/v7.1\/user_stats\/{User ID}\/?aggregate_by_period=year",
"id": "{User ID}",
"name": "year"
}, {
"href": "\/v7.1\/user_stats\/{User ID}\/?aggregate_by_period=day",
"id": "{User ID}",
"name": "day"
}, {
"href": "\/v7.1\/user_stats\/{User ID}\/?aggregate_by_period=week",
"id": "{User ID}",
"name": "week"
}, {
"href": "\/v7.1\/user_stats\/{User ID}\/?aggregate_by_period=lifetime",
"id": "{User ID}",
"name": "lifetime"
}],
"privacy": [{
"href": "\/v7.1\/privacy_option\/1\/",
"id": "1",
"name": "profile"
}, {
"href": "\/v7.1\/privacy_option\/1\/",
"id": "1",
"name": "workout"
}, {
"href": "\/v7.1\/privacy_option\/0\/",
"id": "0",
"name": "bodymass"
}, {
"href": "\/v7.1\/privacy_option\/1\/",
"id": "1",
"name": "food_log"
}, {
"href": "\/v7.1\/privacy_option\/3\/",
"id": "3",
"name": "email_search"
}, {
"href": "\/v7.1\/privacy_option\/1\/",
"id": "1",
"name": "route"
}, {
"href": "\/v7.1\/privacy_option\/0\/",
"id": "0",
"name": "sleep"
}],
"image": [{
"href": "\/v7.1\/user_profile_photo\/{User ID}\/",
"id": "{User ID}",
"name": "user_profile_photo"
}],
"documentation": [{
"href": "https:\/\/developer.mapmyfitness.com\/docs\/v71_User/"
}],
"deactivation": [{
"href": "\/v7.1\/user_deactivation\/"
}],
"user_achievements": [{
"href": "\/v7.1\/user_achievement\/?user={User ID}"
}],
"friendships": [{
"href": "\/v7.1\/friendship\/?from_user={User ID}"
}],
"workouts": [{
"href": "\/v7.1\/workout\/?user={User ID}&order_by=-start_datetime"
}],
"self": [{
"href": "\/v7.1\/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: /v7.1/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": "\/v7.1\/user_stats\/{user ID}\/?aggregate_by_period=month",
"id": "{user ID}",
"name": "month"
}, {
"href": "\/v7.1\/user_stats\/{user ID}\/?aggregate_by_period=year",
"id": "{user ID}",
"name": "year"
}, {
"href": "\/v7.1\/user_stats\/{user ID}\/?aggregate_by_period=day",
"id": "{user ID}",
"name": "day"
}, {
"href": "\/v7.1\/user_stats\/{user ID}\/?aggregate_by_period=week",
"id": "{user ID}",
"name": "week"
}, {
"href": "\/v7.1\/user_stats\/{user ID}\/?aggregate_by_period=lifetime",
"id": "{user ID}",
"name": "lifetime"
}],
"privacy": [{
"href": "\/v7.1\/privacy_option\/1\/",
"id": "1",
"name": "profile"
}, {
"href": "\/v7.1\/privacy_option\/1\/",
"id": "1",
"name": "workout"
}, {
"href": "\/v7.1\/privacy_option\/0\/",
"id": "0",
"name": "bodymass"
}, {
"href": "\/v7.1\/privacy_option\/1\/",
"id": "1",
"name": "food_log"
}, {
"href": "\/v7.1\/privacy_option\/3\/",
"id": "3",
"name": "email_search"
}, {
"href": "\/v7.1\/privacy_option\/1\/",
"id": "1",
"name": "route"
}, {
"href": "\/v7.1\/privacy_option\/0\/",
"id": "0",
"name": "sleep"
}, {
"href": "\/v7.1\/privacy_option\/0\/",
"id": "0",
"name": "workout_music"
}],
"image": [{
"href": "\/v7.1\/user_profile_photo\/{user ID}\/",
"id": "{user ID}",
"name": "user_profile_photo"
}],
"documentation": [{
"href": "https:\/\/developer.mapmyfitness.com\/docs\/v71_User/"
}],
"deactivation": [{
"href": "\/v7.1\/user_deactivation\/"
}],
"user_achievements": [{
"href": "\/v7.1\/user_achievement\/?user={user ID}"
}],
"friendships": [{
"href": "\/v7.1\/friendship\/?from_user={user ID}"
}],
"workouts": [{
"href": "\/v7.1\/workout\/?user={user ID}&order_by=-start_datetime"
}],
"self": [{
"href": "\/v7.1\/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: /v7.1/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": "\/v7.1\/user_stats\/{User ID}\/?aggregate_by_period=month",
"id": "{User ID}",
"name": "month"
}, {
"href": "\/v7.1\/user_stats\/{User ID}\/?aggregate_by_period=year",
"id": "{User ID}",
"name": "year"
}, {
"href": "\/v7.1\/user_stats\/{User ID}\/?aggregate_by_period=day",
"id": "{User ID}",
"name": "day"
}, {
"href": "\/v7.1\/user_stats\/{User ID}\/?aggregate_by_period=week",
"id": "{User ID}",
"name": "week"
}, {
"href": "\/v7.1\/user_stats\/{User ID}\/?aggregate_by_period=lifetime",
"id": "{User ID}",
"name": "lifetime"
}],
"privacy": [{
"href": "\/v7.1\/privacy_option\/1\/",
"id": "1",
"name": "profile"
}, {
"href": "\/v7.1\/privacy_option\/1\/",
"id": "1",
"name": "workout"
}, {
"href": "\/v7.1\/privacy_option\/0\/",
"id": "0",
"name": "bodymass"
}, {
"href": "\/v7.1\/privacy_option\/1\/",
"id": "1",
"name": "food_log"
}, {
"href": "\/v7.1\/privacy_option\/3\/",
"id": "3",
"name": "email_search"
}, {
"href": "\/v7.1\/privacy_option\/1\/",
"id": "1",
"name": "route"
}, {
"href": "\/v7.1\/privacy_option\/0\/",
"id": "0",
"name": "sleep"
}, {
"href": "\/v7.1\/privacy_option\/0\/",
"id": "0",
"name": "workout_music"
}],
"image": [{
"href": "\/v7.1\/user_profile_photo\/{User ID}\/",
"id": "{User ID}",
"name": "user_profile_photo"
}],
"documentation": [{
"href": "https:\/\/developer.mapmyfitness.com\/docs\/v71_User/"
}],
"deactivation": [{
"href": "\/v7.1\/user_deactivation\/"
}],
"user_achievements": [{
"href": "\/v7.1\/user_achievement\/?user={User ID}"
}],
"friendships": [{
"href": "\/v7.1\/friendship\/?from_user={User ID}"
}],
"workouts": [{
"href": "\/v7.1\/workout\/?user={User ID}&order_by=-start_datetime"
}],
"self": [{
"href": "\/v7.1\/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: /v7.1/user/
Response
{
"_links": {
"self": [{
"href": "\/v7.1\/user\/?name=first_name"
}],
"documentation": [{
"href": "https:\/\/developer.mapmyfitness.com\/docs\/v71_User/"
}]
},
"_embedded": {
"routes": [{
...
}],
"total_count": 1000
}