Reference : REST XML API reference : Attributes
  
Attributes
The representation of an attribute contains the value of the attribute. Certain attributes have multiple collection of values and each value has attribute URIs. For example: TextList and File. The representation of the single attribute value also includes the edit links for each text entry in the list.You can change an attribute value of an element by using PUT, POST, or DELETE:
Use PUT operation to update these attribute types: CheckBox, Choice, Date, Float, Integer, Link, LinkList, Matrix, Multichoice, Text, Time Grid, URL, and UniqueId.
For TextList, LinkList and File attributes, use POST operation to add a text entry, link entry or a file.
Use PUT operation to update a text entry, link entry or file, and use DELETE operation to remove a text entry or file.
For a Version attribute, use POST operation to increment to the next major version.
The XML format to update an attribute value is different from the XML representation of the value. For example, a Text attribute might have both a text value and an expression, but when the attribute is updated, it can be given either a new text value or an expression. When you update an attribute, use the XML that is described by the XML Schema document for the attribute.
GET method
Use this method to retrieve the attribute details.
 
URL
https://fpserver.com:9443/fp/resources/workspaces/2/modules/1/elements/15/attributes/220.xml
Accept header
application/xml
Response body
<ns:Text_List writable="true" xsi:schemaLocation="https://fpserver.com:9443/fp/namespace/workspaces/2/modules/1/attribute https://fpserver.com:9443/fp/resources/workspaces/2/modules/1/elements/15/attributes/220/attribute.xsd"> <ns:textList> <fp:textListEntry createdDate="2013-05-02T13:50:09+05:30" lastChangedDate="2013-05-02T13:50:09+05:30"> <fp:author title="Admin"/><fp:lastChangedBy title="Admin"/> <fp:textValue>Sample Text 1</fp:textValue> <fp:formattedTextValue>Sample Text 1<BR></fp:formattedTextValue> <fp:xhtmlTextValue><div>Sample Text 1</div></fp:xhtmlTextValue> <fp:link href="https://fpserver.com:9443/fp/resources/workspaces/2/modules/1/elements/15/attributes/220/entries/1367482809131" rel="edit"/> </fp:textListEntry> <fp:textListEntry createdDate="2013-05-02T13:50:17+05:30" lastChangedDate="2013-05-02T13:50:17+05:30"> <fp:author title="Admin"/><fp:lastChangedBy title="Admin"/> <fp:textValue>Sample Text 2</fp:textValue> <fp:formattedTextValue>Sample Text 2</fp:formattedTextValue> <fp:xhtmlTextValue><div>Sample Text 2</div></fp:xhtmlTextValue> <fp:link href="https://fpserver.com:9443/fp/resources/workspaces/2/modules/1/elements/15/attributes/220/entries/1367482817756" rel="edit"/> </fp:textListEntry> </ns:textList> <ns:alias>ed2ad85f-5b87-4704-b384-e041888439c0</ns:alias> <ns:editLink href="https://fpserver.com:9443/fp/resources/workspaces/2/modules/1/elements/15/attributes/220"/> </ns:Text_List>
 
Parameters
Type
Description
Example
view
Integer
Use this parameter to specify the view ID for retrieving the attributes that are in the view.
 
filter
Integer
This must be used with the view parameter. Use this parameter to pass the filter ID for retrieving elements and attributes based on the filter criteria.
view=14&filter=1
metadata
String
Set the parameter to schema to retrieve the schema of the attibute's XML document
metadata=schema
includeHistoryOfAttributes
start
end
Boolean
Date or Date Time
Date or Date time
Set the parameter to true and specify the start and the end date to retrieve the history of the attributes.
yyyy-MM-dd'T'HH:mm:ss
yyyy-MM-dd'T'HH:mm
yyyy-MM-dd
yyyy-MM-dd HH:mm:ss
yyyy-MM-dd HH:mm
includeHistoryOfAttributes=true&start=2011-03-22T12:00:00+01:00&end=2011-06- 22T12:00:00+01:00
includeHistoryOfAttributes=true&start=2011-03-22T12:00+GMT+01:00&end=2011-06-22T12:00+GMT+01:00
generictimegrid
Boolean
Set the parameter to true for retrieving the time grid attribute sheets in a generic format. This can be used for reporting using Rational Insight.
generictimegrid=true
For details and annotations of the XML format for the service document, see the XML Schema document. The URI for the schema is in the schemaLocation XML attribute of the service document.
POST method
Use this method to create new entry to the attribute collection. This example is on using the POST method to add new values to an attribute TextList collection . The user must have administrator permission for adding values to the attribute collection.
 
URL
http://fpserver.com:8091/fp/resources/workspaces/2/modules/1/elements/53/attributes/237.xml
Accept header
application/xml
Request body
<textListEntryChange xmlns:ns="http://schema.ibm.com/focalpoint/resources"> <ns:textValue>one</ns:textValue> </textListEntryChange>
This example uses the POST method to add new values to a File attribute.
 
URL
http://fpserver.com:8091/fp/resources/workspaces/2/modules/1/elements/53/attributes/228.xml
Accept header
application/xml
Request body
<fileChange xmlns:ns="http://schema.ibm.com/focalpoint/resources"> <ns:fileName>a.txt</ns:fileName> <ns:contentType>plain/text</ns:contentType> <ns:fileData>YWJj</ns:fileData> </fileChange>
This example uses the POST method to add new values to a LinkList attribute and deleting a link.
 
URL
http://fpserver.com:8091/fp/resources/workspaces/2/modules/1/elements/53/attributes/236.xml
Accept header
application/xml
Request body
<linkListChange xmlns:ns="http://schema.ibm.com/focalpoint/resources"> <ns:addLink value="http://fpserver.com:8091/fp/resources/workspaces/2/modules/13/elements/30"> </ns:addLink> <ns:deleteLink value="http://fpserver.com:8091/fp/resources/workspaces/2/modules/13/elements/29"></ns:deleteLink> </linkListChange>
This example uses the POST method to update the value of the Version Attribute to the next major version.
 
URL
http://fpserver.com:8091/fp/resources/workspaces/2/modules/1/elements/53/attributes/245.xml
Accept header
application/xml
Request body
<VersionAttribute nextMajorVersion="true"></VersionAttribute>
PUT methods
This example uses the PUT method to update the attribute value.
 
Attribute type
Request body
Check Box, Lock
<checkBoxChange value="false"> </checkBoxChange>
Choice
<choiceAttributeChange value="Closed"> </choiceAttributeChange>
Date
<dateChange xmlns:ns="http://schema.ibm.com/focalpoint/resources"> <ns:value>2011-01-01T00:00:00+05:30</ns:value> </dateChange>
Float
<floatChange xmlns:ns="http://schema.ibm.com/focalpoint/resources"> <ns:value>201</ns:value> </floatChange>
File
URL example: http://localhost:8080/fp/resources/workspaces/3/modules/13/elements/16/attributes/237/files/01.xml <fileChange xmlns:ns="http://schema.ibm.com/focalpoint/resources"> <ns:fileName>a.txt</ns:fileName> <ns:contentType>plain/text</ns:contentType> <ns:fileData>YWJj</ns:fileData> </fileChange>
Link
<linkValueChange value="http://fpserver.com:8091/fp/resources/workspaces/2/modules/1/elements/16"> </linkValueChange>
Integer
<integerChange xmlns:ns="http://schema.ibm.com/focalpoint/resources"> <ns:value>201</ns:value> </integerChange>
List (Link)
<linkChange xmlns:ns="http://schema.ibm.com/focalpoint/resources"> <ns:linkChange value="http://fpserver.com:8091/fp/resources/workspaces/2/modules/1/elements/72"> </ns:linkChange> <ns:linkChange value="http://fpserver.com:8091/fp/resources/workspaces/2/modules/1/elements/73"> </ns:linkChange> </linkChange>
List (Text)
URL example:
http://localhost:8080/fp/resources/workspaces/3/modules/13/elements/19/attributes/247/entries/1369815257240.xml <textListEntryChange xmlns:ns="http://schema.ibm.com/focalpoint/resources"> <ns:textValue>one</ns:textValue> </textListEntryChange>
Matrix
<matrixChange xmlns:ns="http://schema.ibm.com/focalpoint/resources"> <ns:row> <ns:cell> <ns:value>A</ns:value> </ns:cell> <ns:cell> <ns:value>B</ns:value> </ns:cell> </ns:row> <ns:row> <ns:cell> <ns:value>Row 1</ns:value> </ns:cell> <ns:cell> <ns:value>Simple text value</ns:value> </ns:cell> <ns:cell> <ns:expression>1 + 2</ns:expression> </ns:cell> </ns:row> </matrixChange>
MultiChoice
<multichoiceAttributeValues xmlns:ns="http://fpserver.com:8091/fp/namespace/workspaces/2/modules/1/attribute"> <ns:selected>Open</ns:selected> <ns:selected>One</ns:selected> </multichoiceAttributeValues>
Text
<textAttributeChange xmlns:ns="http://schema.ibm.com/focalpoint/resources"> <ns:textValue>new text value</ns:textValue> </textAttributeChange>
Timegrid (Header)
<timeGridChange xmlns:ns="http://fpserver.com:8091/fp/namespace/workspaces/2/modules/1/attribute"> <ns:timeGridSetting sheetId="1" startDate="2011-12-31" endDate="2012-03-30"> </ns:timeGridSetting> </timeGridChange>
TimeGrid (Data)
<timeGridChange xmlns:ns="http://fpserver.com:8091/fp/namespace/workspaces/2/modules/1/attribute"> <ns:cell sheetId="1" date="2011-12-31" columnId="A" rowId="1"> <ns:value>23</ns:value> </ns:cell> <ns:cell sheetId="1" date="2011-12-31" columnId="A" rowId="2"> <ns:value>24</ns:value> </ns:cell> </timeGridChange>
UniqueID
<uniqueIdChange value="5671"> </uniqueIdChange>
URL
<urlChange value="www.ibm.com/developerworks"> </urlChange>
DELETE method
This example uses the DELETE method to delete the attribute value.
 
Attribute type
Request body
File
URL example:
http://localhost:8080/fp/resources/workspaces/3/modules/13/elements/16/attributes/237/files/01.xml
To delete the 01 file, specify this URL and use the delete command.
List (Text)
URL example:
http://localhost:8080/fp/resources/workspaces/3/modules/13/elements/19/attributes/247/entries/1369815257240.xml
To delete the entry from the list text attribute.
See also
REST XML API reference