Updated in Telligent Evolution platform SDK 5.5.2.
EndpointPOST (Header: PUT)api.ashx/v2/users/{username}.xml (or .json)
EndpointPOST (Header: PUT)api.ashx/v2/users/{id}.xml (or .json)
RequestUserUpdateRequest
| Id |
Optional |
Either Id or Username is required. |
| Username |
Optional |
Either Id or Username is required. |
| User |
Optional |
The submission of a complete user node
is deprecated, will be removed and should not be used for new development. Instead supply user
properties for the request properties (Bio, DisplayName, etc.). |
| OldPassword |
Optional |
Required if changing the password. |
| NewPassword |
Optional |
NewPassword |
| PrivateEmail |
Optional |
PrivateEmail |
| DisplayName |
Optional |
DisplayName |
| Bio |
Optional |
Bio |
| Birthday |
Optional |
Birthday |
| Gender |
Optional |
Gender |
| Language |
Optional |
Language |
| Location |
Optional |
Location |
| PublicEmail |
Optional |
PublicEmail |
| TimeZone |
Optional |
TimeZone |
| WebUrl |
Optional |
WebUrl |
| ProfileFields |
Optional |
ProfileFields |
Example (C#)
var webClient = new WebClient();
// replace the "admin" and "Admin's API key" with your valid user and apikey!
// http://telligent.com/community/developers/w/wiki/how-to-generate-an-api-key.aspx
var adminKey = String.Format("{0}:{1}", "Admin's API Key", "admin");
var adminKeyBase64 = Convert.ToBase64String(Encoding.UTF8.GetBytes(adminKey));
webClient.Headers.Add("Rest-User-Token", adminKeyBase64);
webClient.Headers.Add("Rest-Method", "PUT");
var postUrl = "http://mysite.com/api.ashx/v2/users/2103.xml"; // or .json
var data = "<Request><Username>sample-489a6</Username><OldPassword>sample-data</OldPassword><NewPassword>sample-data</NewPassword><PrivateEmail>sample-f4b2f@email.com</PrivateEmail><DisplayName>sample-data</DisplayName><Bio>sample-data</Bio><Birthday>2010-06-24T15:42:29.7824417-04:00</Birthday><Language>sample-data</Language><Location>sample-data</Location><PublicEmail>sample-data@email.com</PublicEmail><WebUrl>sample-data</WebUrl></Request>";
webClient.UploadData(postUrl, "POST", Encoding.ASCII.GetBytes(data));
Example Response (XML)
<?xml version="1.0" encoding="utf-8"?>
<Response>
<Info />
<Warnings>
<Message>User's password was not updated</Message>
</Warnings>
<Errors />
<User>
<Id>2103</Id>
<AvatarUrl>http://mysite.com/utility/anonymous.gif</AvatarUrl>
<Bio>sample-data</Bio>
<Birthday>2010-06-24T15:42:29</Birthday>
<DisplayName>sample-data</DisplayName>
<Gender>Male</Gender>
<JoinDate>2010-03-29T16:19:49-04:00</JoinDate>
<Language>en-US</Language>
<Location>sample-data</Location>
<Points>0</Points>
<PrivateEmail>sample-f4b2f@email.com</PrivateEmail>
<ProfileUrl>http://mysite.com/members/sample_2D00_489a6/default.aspx</ProfileUrl>
<PublicEmail>sample-data@email.com</PublicEmail>
<TimeZone>-5</TimeZone>
<TimeZoneInfo>Eastern Standard Time;-300;(UTC-05:00) Eastern Time (US & Canada);Eastern Standard Time;Eastern Daylight Time;[01:01:0001;12:31:2006;60;[0;02:00:00;4;1;0;];[0;02:00:00;10;5;0;];][01:01:2007;12:31:9999;60;[0;02:00:00;3;2;0;];[0;02:00:00;11;1;0;];];</TimeZoneInfo>
<Username>sample-489a6</Username>
<WebUrl>sample-data</WebUrl>
<ProfileFields>
<AOLIM />
<Birthday>2010-06-24 15:42:29</Birthday>
<Blog />
<Department />
<Education />
<Email />
<Facebook />
<Gallery />
<Gender>Male</Gender>
<GoogleIM />
<Hobbies />
<Language>en-US</Language>
<Location>sample-data</Location>
<Mobile />
<Occupation />
<Office />
<OfficePhone />
<PublicEmail>sample-data@email.com</PublicEmail>
<Title />
<Twitter />
<Website>sample-data</Website>
<WindowsLiveIM />
<YahooIM />
</ProfileFields>
</User>
</Response>
Example Response (JSON)
{
"User": {
"AvatarUrl": "http://mysite.com/utility/anonymous.gif",
"Bio": "sample-data",
"Birthday": "\/Date(1277408549000-0400)\/",
"CurrentStatus": null,
"DisplayName": "sample-data",
"Gender": 1,
"JoinDate": "\/Date(1269893989000-0400)\/",
"Language": "en-US",
"Location": "sample-data",
"Points": 0,
"PrivateEmail": "sample-f4b2f@email.com",
"ProfileUrl": "http://mysite.com/members/sample_2D00_489a6/default.aspx",
"PublicEmail": "sample-data@email.com",
"TimeZone": -5.0,
"TimeZoneInfo": "Eastern Standard Time;-300;(UTC-05:00) Eastern Time (US & Canada);Eastern Standard Time;Eastern Daylight Time;[01:01:0001;12:31:2006;60;[0;02:00:00;4;1;0;];[0;02:00:00;10;5;0;];][01:01:2007;12:31:9999;60;[0;02:00:00;3;2;0;];[0;02:00:00;11;1;0;];];",
"Username": "sample-489a6",
"WebUrl": "sample-data",
"ProfileFields": [
{
"Label": "AOLIM",
"Value": ""
},
{
"Label": "Birthday",
"Value": "2010-06-24 15:42:29"
},
{
"Label": "Blog",
"Value": ""
},
{
"Label": "Department",
"Value": ""
},
{
"Label": "Education",
"Value": ""
},
{
"Label": "Email",
"Value": ""
},
{
"Label": "Facebook",
"Value": ""
},
{
"Label": "Gallery",
"Value": ""
},
{
"Label": "Gender",
"Value": "Male"
},
{
"Label": "GoogleIM",
"Value": ""
},
{
"Label": "Hobbies",
"Value": ""
},
{
"Label": "Language",
"Value": "en-US"
},
{
"Label": "Location",
"Value": "sample-data"
},
{
"Label": "Mobile",
"Value": ""
},
{
"Label": "Occupation",
"Value": ""
},
{
"Label": "Office",
"Value": ""
},
{
"Label": "OfficePhone",
"Value": ""
},
{
"Label": "PublicEmail",
"Value": "sample-data@email.com"
},
{
"Label": "Title",
"Value": ""
},
{
"Label": "Twitter",
"Value": ""
},
{
"Label": "Website",
"Value": "sample-data"
},
{
"Label": "WindowsLiveIM",
"Value": ""
},
{
"Label": "YahooIM",
"Value": ""
}
],
"Id": 2103
},
"Info": [],
"Warnings": [
"User's password was not updated"
],
"Errors": []
}