{"_id":"56c419a8bb64720d00552b8b","user":"56b98db7bb36440d0001f492","version":{"_id":"56bc8e689afb8b0d00d62dd2","project":"56bc8e679afb8b0d00d62dcf","__v":18,"createdAt":"2016-02-11T13:36:40.146Z","releaseDate":"2016-02-11T13:36:40.146Z","categories":["56bc8e689afb8b0d00d62dd3","56c3c837bc41330d009f25ed","56c3c83e521f350d00d348eb","56c3c8452d97560d00e23cd8","56c3c85234df460d00c2beb8","56c4180d70187b17005f43b4","56c418162d97560d00e23cf6","56c4181cc4796b0d007ef039","56c4182370187b17005f43b5","56c418292e75e01700986052","56c4183328bd680d005e7ac6","56c4183bbb64720d00552b88","56c418414040602b0064cea0","56c4184754b6030d00ec29a1","56c4184c28bd680d005e7ac7","56c4185370187b17005f43b6","56c4185b6063071700500cfc","582a98b6f8c0a0190053d7a5"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0"},"parentDoc":null,"githubsync":"","project":"56bc8e679afb8b0d00d62dcf","__v":10,"category":{"_id":"56c4181cc4796b0d007ef039","version":"56bc8e689afb8b0d00d62dd2","__v":26,"project":"56bc8e679afb8b0d00d62dcf","pages":["56c4192dbc41330d009f25fd","56c4196434df460d00c2bece","56c419814f0aed1700afaba6","56c4198dbc41330d009f25ff","56c419962e75e01700986053","56c4199f54b6030d00ec29a4","56c419a8bb64720d00552b8b","56c419b1bb64720d00552b8d","56c419b92d97560d00e23cf9","56c419c64040602b0064cea3","56c419d4bc41330d009f2601","56c419de70187b17005f43b9","56c419ea6063071700500cfe","56c419fa54b6030d00ec29a6","56c41a096063071700500d00","56c41a1834df460d00c2bed0","56c41a773d30210d00ea8517","56c41a86c4796b0d007ef03e","56c41a904f0aed1700afaba8","56c41a9fbc41330d009f2603","56c41aaa521f350d00d348fe","56c41abb4040602b0064cea5","56c41ad24040602b0064cea7","56c41ade48213b1700af6e28","56c41aeb3d30210d00ea8519","56c41af948213b1700af6e2a"],"sync":{"url":"","isSync":false},"reference":true,"createdAt":"2016-02-17T06:50:04.339Z","from_sync":false,"order":2,"slug":"users","title":"Users"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2016-02-17T06:56:40.486Z","link_external":false,"link_url":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":6,"body":"[block:api-header]\n{\n  \"type\": \"patch\",\n  \"title\": \"/users/{me|id}\"\n}\n[/block]\nUpdates the fields of a user account for the current user, identified by access token. Users are only able to update their own accounts.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"var options = {\\n\\tuserName: \\\"SuperBuddy\\\",\\n\\tpassword: \\\"p4ssw0rd\\\",\\n\\tgender: \\\"Unknown\\\",\\n\\tdateOfBirth: \\\"2014/05/06\\\",\\n\\temail: \\\"support:::at:::buddy.com\\\",\\n\\tfirstName: \\\"First\\\",\\n\\ttag: \\\"Some useful tag\\\",\\n\\tlastName: \\\"Last\\\",\\n\\tprofilePictureID: \\\"bvc.bCkbbffnqbvq\\\",\\n\\tlocationFuzz: true\\n};\\n\\nBuddy.patch('/users/{me|id}',\\n\\t\\toptions,\\n\\t\\tfunction(err, result) {\\n\\t\\t\\t \\n\\t\\t\\tif (result.success) {\\n\\t\\t\\t\\t// Do something with the result!\\n\\t\\t\\t} else { \\n\\t\\t\\t\\t// Otherwise log the error\\n\\t\\t\\t\\tconsole.log(err); \\n\\t\\t\\t} \\n\\t\\t}\\n\\t);\",\n      \"language\": \"javascript\"\n    },\n    {\n      \"code\": \"NSDictionary *params = @{\\n\\t\\t\\[email protected]\\\"userName\\\": @\\\"SuperBuddy\\\",\\n\\t\\t\\[email protected]\\\"password\\\": @\\\"p4ssw0rd\\\",\\n\\t\\t\\[email protected]\\\"gender\\\": @\\\"Unknown\\\",\\n\\t\\t\\[email protected]\\\"dateOfBirth\\\": @\\\"2014/05/06\\\",\\n\\t\\t\\[email protected]\\\"email\\\": @\\\"[email protected]\\\",\\n\\t\\t\\[email protected]\\\"firstName\\\": @\\\"First\\\",\\n\\t\\t\\[email protected]\\\"tag\\\": @\\\"Some useful tag\\\",\\n\\t\\t\\[email protected]\\\"lastName\\\": @\\\"Last\\\",\\n\\t\\t\\[email protected]\\\"profilePictureID\\\": @\\\"bvc.bCkbbffnqbvq\\\",\\n\\t\\t\\[email protected]\\\"locationFuzz\\\": @(YES)\\n\\t\\t};\\n\\n[Buddy PATCH:@\\\"/users/{me|id}\\\" parameters:params class:[BPUser class] callback:^(id obj, NSError *error) {\\n\\t// Your callback code here\\n}];\",\n      \"language\": \"objectivec\",\n      \"name\": \"iOS\"\n    },\n    {\n      \"code\": \"Map<String, Object> parameters = new HashMap<String, Object>();\\nparameters.put(\\\"userName\\\", \\\"SuperBuddy\\\");\\nparameters.put(\\\"password\\\", \\\"p4ssw0rd\\\");\\nparameters.put(\\\"gender\\\", \\\"Unknown\\\");\\nparameters.put(\\\"dateOfBirth\\\", \\\"2014/05/06\\\");\\nparameters.put(\\\"email\\\", \\\"[email protected]\\\");\\nparameters.put(\\\"firstName\\\", \\\"First\\\");\\nparameters.put(\\\"tag\\\", \\\"Some useful tag\\\");\\nparameters.put(\\\"lastName\\\", \\\"Last\\\");\\nparameters.put(\\\"profilePictureID\\\", \\\"bvc.bCkbbffnqbvq\\\");\\nparameters.put(\\\"locationFuzz\\\", true);\\n\\nBuddy.<User>patch(\\\"/users/{me|id}\\\", parameters, new BuddyCallback<User>(User.class) {\\n\\[email protected]\\n\\tpublic void completed(BuddyResult<User> result) {\\n\\t\\t// Your callback code here\\n\\t}\\n});\",\n      \"language\": \"java\",\n      \"name\": \"Android\"\n    },\n    {\n      \"code\": \"var options = new {\\n\\t\\t\\tuserName = \\\"SuperBuddy\\\",\\n\\t\\t\\tpassword = \\\"p4ssw0rd\\\",\\n\\t\\t\\tgender = \\\"Unknown\\\",\\n\\t\\t\\tdateOfBirth = \\\"2014/05/06\\\",\\n\\t\\t\\temail = \\\"[email protected]\\\",\\n\\t\\t\\tfirstName = \\\"First\\\",\\n\\t\\t\\ttag = \\\"Some useful tag\\\",\\n\\t\\t\\tlastName = \\\"Last\\\",\\n\\t\\t\\tprofilePictureID = \\\"bvc.bCkbbffnqbvq\\\",\\n\\t\\t\\tlocationFuzz = true\\n\\t\\t};\\n\\nvar result = await Buddy.PatchAsync<User>(\\\"/users/{me|id}\\\", options);\",\n      \"language\": \"csharp\",\n      \"name\": \".NET\"\n    }\n  ],\n  \"sidebar\": true\n}\n[/block]\n###Path Parameters\n\nThese parameters should be specified as part of the HTTP path.\n[block:parameters]\n{\n  \"data\": {\n    \"0-0\": \"id\",\n    \"0-1\": \"The id of the user to update (or me as shorthand for current user).\",\n    \"0-2\": \"buddyId\",\n    \"0-3\": \"Required\"\n  },\n  \"cols\": 4,\n  \"rows\": 1\n}\n[/block]\n###Body Parameters\n\nThese parameters should be specified as part of the request body.\n[block:parameters]\n{\n  \"data\": {\n    \"0-0\": \"userName\",\n    \"1-0\": \"password\",\n    \"2-0\": \"gender\",\n    \"3-0\": \"dateOfBirth\",\n    \"4-0\": \"email\",\n    \"5-0\": \"firstName\",\n    \"6-0\": \"tag\",\n    \"7-0\": \"lastName\",\n    \"8-0\": \"profilePictureID\",\n    \"9-0\": \"locationFuzz\",\n    \"0-1\": \"A username to identify the user's account. The value must be unique for the application's user base (i.e. duplicate usernames are prohibited across the same application).\",\n    \"1-1\": \"The new password for this user.\",\n    \"2-1\": \"The gender to search by: \\\"Male\\\", \\\"Female\\\", or \\\"Unknown\\\".\",\n    \"3-1\": \"The date/time of the user's birthday. Valid date formats include UTC timestamps specified as Unix ticks (milliseconds since Jan 1, 1970 UTC) such as \\\"1398816000000\\\" and common date formats such as \\\"2014/5/6\\\".\",\n    \"4-1\": \"A valid email address to associate with the user's account. Like the user name, the email address must also be unique. Note: an email address is required to utilize the Request Password Reset API.\",\n    \"5-1\": \"The user's first or given name.\",\n    \"6-1\": \"A string value to attach to this object. This value will be returned with the object as a property called tag.\",\n    \"7-1\": \"The user's last or family name.\",\n    \"8-1\": \"The ID of the picture representing a user in your application.\",\n    \"9-1\": \"Set to \\\"true\\\" to make the user's location less accurate. Defaults to \\\"false\\\".\",\n    \"0-2\": \"string\",\n    \"1-2\": \"string\",\n    \"2-2\": \"string\",\n    \"3-2\": \"string\",\n    \"4-2\": \"string\",\n    \"5-2\": \"string\",\n    \"6-2\": \"string\",\n    \"7-2\": \"string\",\n    \"8-2\": \"buddyId\",\n    \"9-2\": \"string\",\n    \"0-3\": \"Optional\",\n    \"1-3\": \"Optional\",\n    \"2-3\": \"Optional\",\n    \"3-3\": \"Optional\",\n    \"4-3\": \"Optional\",\n    \"5-3\": \"Optional\",\n    \"6-3\": \"Optional\",\n    \"7-3\": \"Optional\",\n    \"8-3\": \"Optional\",\n    \"9-3\": \"Optional\"\n  },\n  \"cols\": 4,\n  \"rows\": 10\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n  \\\"status\\\": 200,\\n  \\\"result\\\": {\\n    \\\"lastLogin\\\": \\\"2014-07-10T19:42:28.463Z\\\",\\n    \\\"email\\\": \\\"[email protected]\\\",\\n    \\\"userName\\\": \\\"NewUserName\\\",\\n    \\\"id\\\": \\\"bv.zDgbbHdJPHnp\\\",\\n    \\\"created\\\": \\\"2014-07-09T19:18:42.603Z\\\",\\n    \\\"lastModified\\\": \\\"2014-07-10T19:42:28.463Z\\\"\\n  },\\n  \\\"request_id\\\": \\\"53beeca4b32fad0e1c32ae2c\\\",\\n  \\\"success\\\": true\\n} \",\n      \"language\": \"json\",\n      \"name\": \"Response\"\n    }\n  ],\n  \"sidebar\": true\n}\n[/block]","excerpt":"","slug":"update-user","type":"basic","title":"Update User"}
[block:api-header] { "type": "patch", "title": "/users/{me|id}" } [/block] Updates the fields of a user account for the current user, identified by access token. Users are only able to update their own accounts. [block:code] { "codes": [ { "code": "var options = {\n\tuserName: \"SuperBuddy\",\n\tpassword: \"p4ssw0rd\",\n\tgender: \"Unknown\",\n\tdateOfBirth: \"2014/05/06\",\n\temail: \"[email protected]\",\n\tfirstName: \"First\",\n\ttag: \"Some useful tag\",\n\tlastName: \"Last\",\n\tprofilePictureID: \"bvc.bCkbbffnqbvq\",\n\tlocationFuzz: true\n};\n\nBuddy.patch('/users/{me|id}',\n\t\toptions,\n\t\tfunction(err, result) {\n\t\t\t \n\t\t\tif (result.success) {\n\t\t\t\t// Do something with the result!\n\t\t\t} else { \n\t\t\t\t// Otherwise log the error\n\t\t\t\tconsole.log(err); \n\t\t\t} \n\t\t}\n\t);", "language": "javascript" }, { "code": "NSDictionary *params = @{\n\t\t\[email protected]\"userName\": @\"SuperBuddy\",\n\t\t\[email protected]\"password\": @\"p4ssw0rd\",\n\t\t\[email protected]\"gender\": @\"Unknown\",\n\t\t\[email protected]\"dateOfBirth\": @\"2014/05/06\",\n\t\t\[email protected]\"email\": @\"[email protected]\",\n\t\t\[email protected]\"firstName\": @\"First\",\n\t\t\[email protected]\"tag\": @\"Some useful tag\",\n\t\t\[email protected]\"lastName\": @\"Last\",\n\t\t\[email protected]\"profilePictureID\": @\"bvc.bCkbbffnqbvq\",\n\t\t\[email protected]\"locationFuzz\": @(YES)\n\t\t};\n\n[Buddy PATCH:@\"/users/{me|id}\" parameters:params class:[BPUser class] callback:^(id obj, NSError *error) {\n\t// Your callback code here\n}];", "language": "objectivec", "name": "iOS" }, { "code": "Map<String, Object> parameters = new HashMap<String, Object>();\nparameters.put(\"userName\", \"SuperBuddy\");\nparameters.put(\"password\", \"p4ssw0rd\");\nparameters.put(\"gender\", \"Unknown\");\nparameters.put(\"dateOfBirth\", \"2014/05/06\");\nparameters.put(\"email\", \"[email protected]\");\nparameters.put(\"firstName\", \"First\");\nparameters.put(\"tag\", \"Some useful tag\");\nparameters.put(\"lastName\", \"Last\");\nparameters.put(\"profilePictureID\", \"bvc.bCkbbffnqbvq\");\nparameters.put(\"locationFuzz\", true);\n\nBuddy.<User>patch(\"/users/{me|id}\", parameters, new BuddyCallback<User>(User.class) {\n\[email protected]\n\tpublic void completed(BuddyResult<User> result) {\n\t\t// Your callback code here\n\t}\n});", "language": "java", "name": "Android" }, { "code": "var options = new {\n\t\t\tuserName = \"SuperBuddy\",\n\t\t\tpassword = \"p4ssw0rd\",\n\t\t\tgender = \"Unknown\",\n\t\t\tdateOfBirth = \"2014/05/06\",\n\t\t\temail = \"[email protected]\",\n\t\t\tfirstName = \"First\",\n\t\t\ttag = \"Some useful tag\",\n\t\t\tlastName = \"Last\",\n\t\t\tprofilePictureID = \"bvc.bCkbbffnqbvq\",\n\t\t\tlocationFuzz = true\n\t\t};\n\nvar result = await Buddy.PatchAsync<User>(\"/users/{me|id}\", options);", "language": "csharp", "name": ".NET" } ], "sidebar": true } [/block] ###Path Parameters These parameters should be specified as part of the HTTP path. [block:parameters] { "data": { "0-0": "id", "0-1": "The id of the user to update (or me as shorthand for current user).", "0-2": "buddyId", "0-3": "Required" }, "cols": 4, "rows": 1 } [/block] ###Body Parameters These parameters should be specified as part of the request body. [block:parameters] { "data": { "0-0": "userName", "1-0": "password", "2-0": "gender", "3-0": "dateOfBirth", "4-0": "email", "5-0": "firstName", "6-0": "tag", "7-0": "lastName", "8-0": "profilePictureID", "9-0": "locationFuzz", "0-1": "A username to identify the user's account. The value must be unique for the application's user base (i.e. duplicate usernames are prohibited across the same application).", "1-1": "The new password for this user.", "2-1": "The gender to search by: \"Male\", \"Female\", or \"Unknown\".", "3-1": "The date/time of the user's birthday. Valid date formats include UTC timestamps specified as Unix ticks (milliseconds since Jan 1, 1970 UTC) such as \"1398816000000\" and common date formats such as \"2014/5/6\".", "4-1": "A valid email address to associate with the user's account. Like the user name, the email address must also be unique. Note: an email address is required to utilize the Request Password Reset API.", "5-1": "The user's first or given name.", "6-1": "A string value to attach to this object. This value will be returned with the object as a property called tag.", "7-1": "The user's last or family name.", "8-1": "The ID of the picture representing a user in your application.", "9-1": "Set to \"true\" to make the user's location less accurate. Defaults to \"false\".", "0-2": "string", "1-2": "string", "2-2": "string", "3-2": "string", "4-2": "string", "5-2": "string", "6-2": "string", "7-2": "string", "8-2": "buddyId", "9-2": "string", "0-3": "Optional", "1-3": "Optional", "2-3": "Optional", "3-3": "Optional", "4-3": "Optional", "5-3": "Optional", "6-3": "Optional", "7-3": "Optional", "8-3": "Optional", "9-3": "Optional" }, "cols": 4, "rows": 10 } [/block] [block:code] { "codes": [ { "code": "{\n \"status\": 200,\n \"result\": {\n \"lastLogin\": \"2014-07-10T19:42:28.463Z\",\n \"email\": \"[email protected]\",\n \"userName\": \"NewUserName\",\n \"id\": \"bv.zDgbbHdJPHnp\",\n \"created\": \"2014-07-09T19:18:42.603Z\",\n \"lastModified\": \"2014-07-10T19:42:28.463Z\"\n },\n \"request_id\": \"53beeca4b32fad0e1c32ae2c\",\n \"success\": true\n} ", "language": "json", "name": "Response" } ], "sidebar": true } [/block]