Retrieving a profile photo
Added by IBM contributorIBM | Edited by Claudia R Elbourn on June 15, 2015
Rate this article 1 starsRate this article 2 starsRate this article 3 starsRate this article 4 starsRate this article 5 stars

To retrieve the image file that supplies a person's photo to a profile, use the image link returned in the entry document.

You can retrieve profile photos for any person in your organization. You will still have to authenticate when you make the request if the server is set up to force all traffic to use SSL.

To retrieve an image file from a profile, complete the following steps:
1. Get the service document for the person's profile. See Retrieving the Profiles service document.
2. From the service document, get the URI for the profiles feed which is specified in the href attribute of the collection element and use it to get the profiles feed for the user.
3. In the returned feed, find the link where the rel attribute has the value "http://www.ibm.com/xmlns/prod/sn/image" .../>. Alternatively, use the URI specified in the "Request Details" table below.

<link

href="https://profiles.enterprise.example.com/profiles/photo.do?key=

b559403a-9r32-2c81-c99w-ppq8bb69442j&lastMod=1204662695516"

rel="http://www.ibm.com/xmlns/prod/sn/image"

type="image" /> 


4. Use this link to send a GET request to retrieve the image file.

You will need a REST client that supports a binary stream of the media file you are trying to retrieve.

The output of this operation is a binary image file.

Input
Method URI Description
GET /profiles/photo.do Value of the href attribute of the <link rel="http://www.ibm.com/xmlns/prod/sn/image" .../> element in the user's profiles feed.
Name Type Optional Description
key
string No An ID generated by Profiles to identify a certain profile.
lastmod
date Yes The date it was last modified in numerical value.
guid
string Yes An ID generated by the Connections Cloud system to identify a certain profile. This is the ID visible in other services
Output
Name Type Optional Description
Content-Type
string No Indicates format of the response to a GET request. Use "image/jpeg", "image/png", or "image/gif".
Content-Length
string No Indicates the length of the response to a GET request.
Code Description
200
OK. Indicates that the request was received successfully.
404
URL could not be found