Updated in Telligent Evolution platform SDK 5.5.2.
EndpointGETapi.ashx/v2/users/{username}.xml (or .json)
EndpointGETapi.ashx/v2/users/{id}.xml (or .json)
RequestUserShowRequest
| Id |
Optional |
Either Id or Username is required. |
| Username |
Optional |
Either Id or Username is required. |
If you request a user whose username looks like a number (e.g. “12345”), the API will assume it’s a User ID rather than a username. For such scenarios, you should use the Get Users endpoint, specifying the username on the usernames parameter e.g. /api.ashx/v2/users.xml?usernames=12345.
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);
var requestUrl = "http://mysite.com/api.ashx/v2/users/2103.xml"; // or .json
var xml = webClient.DownloadString(requestUrl);
Console.WriteLine(xml);
Example Response (XML)
<?xml version="1.0" encoding="utf-8"?>
<Response>
<Info />
<Warnings />
<Errors />
<User>
<Id>2103</Id>
<AvatarUrl>http://mysite.com/utility/anonymous.gif</AvatarUrl>
<Bio>sample-data</Bio>
<Birthday>2010-06-24T15:41:41</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-f78f6@email.com</PrivateEmail>
<ProfileUrl>http://mysite.com/members/sample_2D00_30dbc/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-30dbc</Username>
<WebUrl>sample-data</WebUrl>
<ProfileFields>
<AOLIM />
<Birthday>2010-06-24 15:41:41</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(1277408501000-0400)\/",
"CurrentStatus": null,
"DisplayName": "sample-data",
"Gender": 1,
"JoinDate": "\/Date(1269893989000-0400)\/",
"Language": "en-US",
"Location": "sample-data",
"Points": 0,
"PrivateEmail": "sample-f78f6@email.com",
"ProfileUrl": "http://mysite.com/members/sample_2D00_30dbc/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-30dbc",
"WebUrl": "sample-data",
"ProfileFields": [
{
"Label": "AOLIM",
"Value": ""
},
{
"Label": "Birthday",
"Value": "2010-06-24 15:41:41"
},
{
"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": [],
"Errors": []
}