Home

 

Replacing a photo

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 the photo of the user whose credentials you provided to authenticate with the server See Authenticating requests for information about how to authenticate the request. To replace the photo associated with a profile...

  1. Get the service document for the person's profile. See Retrieving the Profiles service document.

  2. 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.

  3. Find the <link rel="http://www.ibm.com/xmlns/prod/sn/image" .../> element returned in the feed. For example:

      <link 
           href="https://profiles.enterprise.acme.com/profiles/photo.do?key=
            b559403a-9r32-2c81-c99w-ppq8bb69442j&lastMod=1204662695516" 
           rel="http://www.ibm.com/xmlns/prod/sn/image" 
           type="image" /> 
      

  4. Send a PUT request to the Web address specified in the href attribute.

    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.


Atom API request details

Method Resource URI Input representation
PUT image file 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"

 

Input

Provide the following items in the HTTP request:

 

Output

None. Returned HTTP Headers


Working with profile photos

 

Related reference


Retrieving a profile photo


+

Search Tips   |   Advanced Search