Add a profile using the Administration API
To add a profile to the Profiles application, send a profile entry document in Atom format to the appropriate resource of the Administration API.Table 1. Atom API request details
Method URI Input representation POST /admin/atom/profiles.do profile Provide one of the following parameters as part of the request:
Table 2. Input parameters
Parameter Description 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 Unique ID that represents a specific person. This value is specified in the <snx:userid> element.
Input
Provide a profile entry Atom entry document as the POST data. The content type of the Atom entry document must be application/atom+xml. The following entries must be provided in the profile entry document:
<entry> <key>com.ibm.snx_profiles.base.distinguishedName</key> <value> <type>text</type> <data>uid={uid},cn={container},l={city},st={state},c={country}, ou={org_unit},o={org},dc={domain_component},dc={domain_component} </data> </value> </entry>
<entry> <key>com.ibm.snx_profiles.base.guid</key> <value> <type>text</type> <data>{user_ID}</data> </value> </entry>
<entry> <key>com.ibm.snx_profiles.base.surname</key> <value> <type>text</type> <data>{Surname}</data> </value> </entry>
<entry> <key>com.ibm.snx_profiles.base.uid</key> <value> <type>text</type> <data>{uid}</data> </value> </entry>
All other entries are optional.
Output
NoneReturned HTTP headers
HTTP/1.1 200 OK
Indicates that the profile entry was successfully created. If an error occurs, this header contains one of the error codes.
Errors
- HTTP/1.1 400 Bad Request
- HTTP/1.1 401 Unauthorized
- HTTP/1.1 404 Not Found
Example
To add a profile for Susanne Jones to the Profiles application...
- Create a profile entry document. You might need to investigate which codes your LDAP directory uses for the values required by the distinguishedName entry. The following XML snippet is a sample profile entry document.
<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>sjones@example.com</data> </value> </entry> <entry> <key>com.ibm.snx_profiles.base.uid</key> <value> <type>text</type> <data>susjones</data> </value> </entry> <entry> <key>com.ibm.snx_profiles.base.givenNames</key> <value> <type>text</type> <data>Susanne</data> </value> </entry> <entry> <key>com.ibm.snx_profiles.base.surname</key> <value> <type>text</type> <data>Jones</data> </value> </entry> <entry> <key>com.ibm.snx_profiles.base.displayName</key> <value> <type>text</type> <data>Susy Jones</data> </value> </entry> <entry> <key>com.ibm.snx_profiles.base.distinguishedName</key> <value> <type>text</type> <data>uid=susjones,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>5a9501c0-0101-102e-8ce4-f78755f7e0ed</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>
- Send a POST request to the /admin/atom/profiles.do resource and pass this document as input on the request.
Parent topic
Work with profiles using the Administration API
});