I am attempting to retrieve some profile properties for the current user, and am having a hard time with the profile picture Url specifically. Version is Sharepoint Foundation 2013.

When I open the Url from the following:

requestUri = _spPageContextInfo.webAbsoluteUrl + "/_api/Web/SiteUserInfoList/Items(" + userid + ")?$select=Title,Picture";

I get the following xml:

<category term="SP.Data.UserInfoItem" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" />
<link rel="edit" href="Web/SiteUserInfoList/Items(userid)" />
<title />
<author><name /></author>
<content type="application/xml">
      <d:Title>User Full Name</d:Title>
      <d:Picture m:type="SP.FieldUrlValue">

And I'm attempting to use the properties returned in this function:

function onSuccess(data, request){
  var fullName = data.d.Title;
  var profilePic = data.d.Picture;
  $("#profileImage").attr("src", profilePic);

I am able to return the Title property no problem, but I had no success getting the picture url. I was able to work around it with the following changes, but it seems a little open to potential issues:

var requestUri = _spPageContextInfo.webAbsoluteUrl + "/_api/Web/SiteUserInfoList/Items(" + userid + ")/FieldValuesAsText?$select=Title,Picture";

var profilePic = data.d.Picture.split(',')[0];

This returned both the Url and Description properties in a string separated by ", " which could be split to give me the value I needed. Is there a way I can drill down to select the Picture Url property directly, or is this a limitation of Rest? Any help would be greatly appreciated.

2 Answers 2


You use below snippet for getting display name & picture for current logged in user.


    url: _spPageContextInfo.webAbsoluteUrl + "/_api/SP.UserProfiles.PeopleManager/GetMyProperties",
    headers: {
        Accept: "application/json;odata=verbose"
    success: function (data) {
        try {
            profileDisplayName = data.d.DisplayName;
            profilePicture = data.d.PictureUrl;

        } catch (err2) {
            // alert(JSON.stringify(err2));
    error: function (jQxhr, errorCode, errorThrown) {

Hope this helps

Sorry my bad , i didn't the sharePoint version. Please ignore


The way I have done it in o365 which I think it is the same SP 2013. results object had the user properties

var results = data.d.results;
var image = siteURL + "/_layouts/15/userphoto.aspx?size=L&accountname=";
<div class='contact-item'><div class='contact-profile-image'><img src='" + image + results[i].Person.EMail + "'></div>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.