Community articleUpdating profiles codes using Administration API
Added by IBM contributorIBM on May 7, 2014
Rate this article 1 starsRate this article 2 starsRate this article 3 starsRate this article 4 starsRate this article 5 stars

No abstract provided.

To update a code definition, send an updated code 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.

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.


The following is an example of an entry document for a work location RN, which corresponds to sample data contained in the TDI solution:

<entry>
<key>com.ibm.snx_profiles.base.displayName</key>
<id>tag:profiles.ibm.com,2006:com.ibm.snx_profiles.codes.worklocation:RN</id>
<content type="application/xml">
<appData xmlns="http://ns.opensocial.org/2008/opensocial">
<com.ibm.snx_profiles.codes.worklocation.workLocationCode>
RN
</com.ibm.snx_profiles.codes.worklocation.workLocationCode>
<com.ibm.snx_profiles.codes.worklocation.address2>
Casino Row
</com.ibm.snx_profiles.codes.worklocation.address2>
<com.ibm.snx_profiles.codes.worklocation.state>
Nevada
</com.ibm.snx_profiles.codes.worklocation.state>
<com.ibm.snx_profiles.codes.worklocation.address1>
Tropicana Hotel
</com.ibm.snx_profiles.codes.worklocation.address1>
<com.ibm.snx_profiles.codes.worklocation.postalCode>
89501
</com.ibm.snx_profiles.codes.worklocation.postalCode>
<com.ibm.snx_profiles.codes.worklocation.city>
Reno
</com.ibm.snx_profiles.codes.worklocation.city>
</appData>
</content>
</entry>

Output

None.

Input
Method URI Description
PUT /profiles/admin/atom/codes/Country.do country
PUT /profiles/admin/atom/codes/Department.do department
PUT /profiles/admin/atom/codes/EmployeeType.do employee type
PUT /profiles/admin/atom/codes/Organization.do organization
PUT /profiles/admin/atom/codes/WorkLocation.do work location
Content Type: application/atom+xml
Name Type Optional Description
codeId
string No Unique ID that represents a specific code. This value is specified in the <id> such as <id>tag:profiles.ibm.com,2006:com.ibm.snx_profiles.codes.country:ad</id>
Output
Content Type: application/atom+xml
Code Description
200
Indicates that the profile entry was successfully updated. If an error occurs, this header contains one of the error codes.
400
Bad Request
401
Unauthorized
404
Not Found
Examples
1.Retrieve the profile entry for RN by sending the following request:
GET /profiles/admin/atom/codes/WorkLocation.do?codeId=RN 

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.codes.worklocation.address2 <key> element to read as follows:
<com.ibm.snx_profiles.codes.worklocation.address2>The Strip</com.ibm.snx_profiles.codes.worklocation.address2>

4.Do not remove or edit any other entries. Save and close the updated profile entry.

5.Update the code entry in the Profiles database by sending a PUT request to the web address specified in the edit link of the code document. For example:
PUT /profiles/admin/atom/codes/WorkLocation.do?codeId=RN