To create new tags and assign tags to specific items, use the /pathways/api/item/[id]/tag interface.
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <soc:PTagList xmlns:soc="http://social.bea.com/pathways"> <tag> <count>1</count> <isAppliedByCurrentUser>true</isAppliedByCurrentUser> <normalizedCount>9</normalizedCount> <value>phenomenon</value> </tag> <tag> <count>1</count> <isAppliedByCurrentUser>true</isAppliedByCurrentUser> <normalizedCount>9</normalizedCount> <value>sudden</value> </tag> </soc:PTagList>
POST /pathways/api/item/PTPORTAL/1_210/tags CSP-Session-Token: 1|1207243836|0d6PFr/Z+mRrarbn9uhZJyYL2uI= Host: smahendr03.amer.bea.com:11990 Accept-Language: en-us ACCEPT: application/xml <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <soc:PTagList xmlns:soc="http://social.bea.com/pathways"> <tag> <value>foo</value> </tag> <tag> <value>bar</value> </tag> </soc:PTagList>The response confirms that the request was successful:
HTTP/1.1 201 Created <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <soc:PTagList xmlns:soc="http://social.bea.com/pathways"> <tag> <value>foo</value> </tag> <tag> <value>bar</value> </tag> </soc:PTagList>This same request could be used with the HTTP DELETE method to remove these tags from the item. The successful response code would be 202 Accepted instead of 201 Created.
Users with WRITE_APPLICATION capability can delete tags that they applied or tags applied by other users. For example, an administrator could remove all tags corresponding to "acquisition" for everyone (the "ev" view) or, more narrowly, for another group view, or for a specifically identified user (“custom/[ptsource]/[userid]”).
For example, the following request deletes tag ‘foo’ from all items in view ‘bar’: DELETE /pathways/api/tag/bar/foo.
The response confirms that the request was successful:HTTP/1.1 202 Accepted <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <soc:PTagViewStatus xmlns:soc="http://social.bea.com/pathways"> <value>foo</value> <appliedItem>PTPORTAL:18:201</appliedItem> <appliedItem>PTPORTAL:18:203</appliedItem> </soc:PTagViewStatus>In the example above, ‘foo’ was removed from Knowledge Directory items with object IDs of 201 and 203.
Users with WRITE_APPLICATION capability can rename tags that they applied or tags applied by other users. For example, an administrator could rename all “HR” tags to “human resources” for everyone (the "ev" view) or, more narrowly, for another group view, or for a specifically identified user (“custom/[ptsource]/[userid]”).
For example, the following request renames tag ‘foo’ to ‘bar’ from all items in view ‘ev’:
PUT /pathways/api/tag/ev/foo CSP-Session-Token: 1|1207243836|0d6PFr/Z+mRrarbn9uhZJyYL2uI= Host: smahendr03.amer.bea.com:11990 Accept-Language: en-us ACCEPT: application/xml <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <soc:PTagViewStatus xmlns:soc="http://social.bea.com/pathways"> <value>bar</value> </soc:PTagViewStatus>The response confirms that the request was successful:
HTTP/1.1 202 Accepted <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <soc:PTagViewStatus xmlns:soc="http://social.bea.com/pathways"> <value>bar</value> <appliedItem>PTPORTAL:18:201</appliedItem> <appliedItem>PTPORTAL:18:203</appliedItem> </soc:PTagViewStatus>In the example above, the tag ‘bar’ replaced the tag ‘foo’ for Knowledge Directory items with object IDs of 201 and 203.