Community articleUpdating a profile using the Administration API
Added by IBM contributorIBM | Edited by IBM contributorLDD Webmaster on July 1, 2014
Rate this article 1 starsRate this article 2 starsRate this article 3 starsRate this article 4 starsRate this article 5 stars

To update a person's profile, send an updated profile entry document in Atom format to the appropriate resource of the Administration API.



To update a person's profile, send an updated profile entry document in Atom format to the appropriate resource of the Administration API.

All profile entry information will be replaced with new data. To avoid deleting existing data, retrieve any data you want to retain first, and send it back with this request. See Retrieving profile entries using the Administration API for more information.

 

You must provide either the email or userid parameter as part of the request.

Input

Provide a profile entry Atom entry document as the PUT data. The content type of the Atom entry document must be application/atom+xml. Do not remove the entries that contain the following key values from the profile entry document:


  • com.ibm.snx_profiles.base.distinguishedName
  • com.ibm.snx_profiles.base.guid
  • com.ibm.snx_profiles.base.surname
  • com.ibm.snx_profiles.base.uid
     

To remove a setting, keep the attribute in the Atom entry document, but leave the <data> element empty. For example, to remove the current display name from an existing record, specify the following information:

<entry>

	<key>com.ibm.snx_profiles.base.displayName</key>

	<value>

	<type>text</type>

	<data></data>

	</value>

	</entry>


Output

None.

 

 

Input
Method URI Description
PUT /profiles/admin/atom/profileEntry.do The URI used to retrieve a profile entry
Content Type: application/atom+xml
Sample Request:
<!-- Example: Adds Amy Jones560 to the Profiles application!-->
<entry
	xmlns="http://www.w3.org/2005/Atom"
	xmlns:app="http://www.w3.org/2007/app"
	xmlns:snx="http://www.ibm.com/xmlns/prod/sn">
	<id>ignored</id>
	<category term="profile" scheme="http://www.ibm.com/xmlns/prod/sn/type" />
	<content type="application/xml">
	<person xmlns="http://ns.opensocial.org/2008/opensocial">
	<com.ibm.snx_profiles.attrib>

	<entry>
	<key>com.ibm.snx_profiles.base.email</key>
	<value>
	<type>text</type>
	<data>ajones560@janet.iris.com</data>
	</value>
	</entry>

	<entry>
	<key>com.ibm.snx_profiles.base.uid</key>
	<value>
	<type>text</type>
	<data>ajones560</data>
	</value>
	</entry>
	<entry>
	<key>com.ibm.snx_profiles.base.givenNames</key>
	<value>
	<type>text</type>
	<data>Amy</data>
	</value>
	</entry>

	<entry>
	<key>com.ibm.snx_profiles.base.surname</key>
	<value>
	<type>text</type>
	<data>Jones560</data>
	</value>
	</entry>

	<entry>
	<key>com.ibm.snx_profiles.base.displayName</key>
	<value>
	<type>text</type>
	<data>Amy Jones560</data>
	</value>
	</entry>

	<entry>
<key>com.ibm.snx_profiles.base.distinguishedName</key>
	<value>
	<type>text</type>
<data>uid=ajones560,cn=users,l=Portland,st=Maine,c=US,ou=Enterprise,
	o=Software Group,dc=example,dc=com
	</data>
	</value>
	</entry>

	<entry>
	<key>com.ibm.snx_profiles.base.guid</key>
	<value>
	<type>text</type>
	<data>1bb4b671-1015-4aaf-8790-4aa31a5f6702</data>
	</value>
	</entry>

	<entry>
	<key>com.ibm.snx_profiles.sys.usrState</key>
	<value>
	<type>text</type>
	<data>active</data>
	</value>
	</entry>
	</com.ibm.snx_profiles.attrib>
	</person>
	</content>
	</entry> 
Name Type Optional Description
email
string Yes Internet email address of the user whose profile you want to retrieve. Format the HTTP request using the proper URL encoding. For example, the encoded form of the @ symbol is %40.
Note: Do not use this parameter if LotusĀ® Connections is configured to prevent email addresses from being displayed. It will return an error code 400 for an invalid request. Use the key or userid parameters instead.
This parameter is ignored if the userid parameter is also specified.
userid
string No Unique ID that represents a specific person. This value is specified in the <snx:userid> element.
Output
Code Description
200
OK. Indicates that the request was received successfully.
400
Bad Request. Returned when no matching user record can be found.
401
Unauthorized. Returned when no authenticated user or no userid, email, or key parameter are provided on the request.
404
Not Found
Examples
To change the display name used for Madeleine Brown from Madeleine Brown to Maddie Brown, complete the following steps:
1. Retrieve the profile entry for Madeleine by sending the following request:
GET /profiles/admin/atom/profileEntry.do?email=mbrown%40example.com
2. Make a copy of the returned entry document.
3. In the copy, edit the value of the <data> element associated with the com.ibm.snx_profiles.base.displayName <key> element to read as follows:
4. Do not remove or edit any other entries. Save and close the updated profile entry.
5. Update Maddie's profile in the Profiles database by sending a PUT request to the web address specified in the edit link of her profile document. 

PUT /profiles/admin/atom/profileEntry.do?key=e011a7b5-8a1e-43ea-90ec-c303fb4ed80a HTTP/1.1

<entry>
  <key>com.ibm.snx_profiles.base.displayName</key>
  <value>
    <type>text</type>
    <data>Maddie Brown</data>
  </value>
</entry>