To replace the image file that supplies the photo for a person's profile, send a binary image file to the web address defined in the image file link returned by the Profile's entry document.
You can only replace a photo if you are the profile owner or an administrator. See Authenticating requests
for information about how to authenticate the request.
To replace the photo associated with a profile, complete the following steps:
Note: Be sure to make the new image file available to the application. For example, if you are writing a Java™ application, you might use a method that extends the EntityEnclosingMethod class to reference the file. Or, you might make the file available by adding it to a file system location that is HTTP addressable.
Get the service document for the person's profile. See Retrieving the Profiles service document.
Get the URI of the profiles feed which is specified in the href attribute of the collection element in the service document and use it to get the profiles feed for the person.
Find the <link rel="http://www.ibm.com/xmlns/prod/sn/image" .../> element returned in the feed. For example:
Send a PUT request to the web address specified in the href attribute.
Table 1. Atom API request details
Value of the href attribute of the <link rel="http://www.ibm.com/xmlns/prod/sn/image" .../> element in the user's profiles feed.
"image/jpeg", "image/pjpeg", or "image/gif"
Provide the following items in the HTTP request:
A "Content-Type" HTTP header indicating the format of the binary image data in the payload
The binary image file data in the format indicated by the Content-Type header in the payload of the request.
Returned HTTP headers
HTTP/1.1 200 OK
Indicates that the photo was successfully updated.
Parent topic: Working with profile photos
Retrieving a profile photo