Remove a photo from a profileTo remove a photo from a profile, use the HTTP DELETE method.
You can only remove the image file from a profile if you are the profile owner or an administrator. See Authenticating requests for information about how to authenticate the request.
To remove a photo from a profile...
- Get the service document for the person's profile. See Retrieve 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:
<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" />
- Send a DELETE request to the web address specified in the href attribute.
By default, Profiles provides a generic image for users who have deleted or not added a photo to their profile.
Table 1. Atom API request details
Method Resource URI Input and output representations DELETE image file Found in the href attribute of <link rel="http://www.ibm.com/xmlns/prod/sn/image" .../> element in the user's profiles feed. none
Returned HTTP headers
HTTP/1.1 204 No Content
Indicates activity was successfully deleted (and no content is returned).
- HTTP/1.1 403 Forbidden: Authorization failed.
- HTTP/1.1 404 Not Found
Parent topicWork with profile photos