Creating an activity node from a template
Added by IBM contributorIBM | Edited by Claudia R Elbourn on July 7, 2015
Rate this article 1 starsRate this article 2 starsRate this article 3 starsRate this article 4 starsRate this article 5 stars

Create activity nodes of type entry from an entry template.

Retrieve the Atom document of the entry template that you want to use, edit the document to contain your new entry content, and then post the edited Atom document to the activity's node list.

Location: url

Link to edit_url of the new activity node that can be used to update it.

Input
Method URI Description
POST /activities/service/atom2/activity Value of the href attribute of the <app:collection> element of the activity.
Content Type: application/atom+xml
Name Type Optional Description
activityUuid
string No The UUID of the activity you to create a node in.
Output
Name Type Optional Description
Location
string No Link to edit_url of the new activity node that can be used to update it.
Code Description
201
Indicates that the activity entry was successfully created. If an error occurs, this header contains one of the error codes.
400
Bad Request.
403
Forbidden. Authorization failed.
Examples
To create an entry from an entry template:

<category

	scheme="http://www.ibm.com/xmlns/prod/sn/type"

	term="entrytemplate"

	label="Entry Template">

	</category>



with the following category element:

<category

	xmlns:snx="http://www.ibm.com/xmlns/prod/sn"

	scheme="http://www.ibm.com/xmlns/prod/sn/type"

	term="entry"

	snx:template-id="794G09219C73CC5C30A4F106B852AD000136">

	</category>

POST /atom2/activity?activityUuid=793G09219C73CC5C30A4F106B852AD00012F

	HTTP/1.1

	Host: activities.dulcinea.enterprise.com

	Content-Type: application/atom+xml

	Authorization: Basic xxx

	Content-Length: nnn 

    Retrieve the Atom document of the entry template that you want to use. See Retrieving entry templates for more details.
    Replace the category element that defines the template:
    Post the updated Atom document to the activity using a request with the following syntax:

This is a sample of an entry template Atom document that has been retrieved to use as the basis for a new entry:

<entry

	xmlns="http://www.w3.org/2005/Atom"

	xmlns:snx="http://www.ibm.com/xmlns/prod/sn">

	<id>urn:lsid:ibm.com:oa:794G09219C73CC5C30A4F106B852AD000136</id>

	<title type="text">New entry from entry template test</title>

	<updated>2009-01-02T20:45:07Z</updated>

	<published>2009-01-02T20:45:07Z</published>

	<author>

	<name>donquixote@dulcinea.com</name>

	<email>donquixote@dulcinea.com</email>

	<snx:userid

	xmlns:snx="http://www.ibm.com/xmlns/prod/sn">donquixote@dulcinea.com

	</snx:userid>

	<snx:ldapid xmlns:snx="http://www.ibm.com/xmlns/prod/sn">

	177G09219C7341D31A078B4D3F1552000000

	</snx:ldapid>

	</author>

	<contributor>

	<name>donquixote@dulcinea.com</name>

	<email>donquixote@dulcinea.com</email>

	<snx:userid xmlns:snx="http://www.ibm.com/xmlns/prod/sn">

	donquixote@dulcinea.com

	</snx:userid>

	<snx:ldapid xmlns:snx="http://www.ibm.com/xmlns/prod/sn">

	177G09219C7341D31A078B4D3F1552000000

	</snx:ldapid>

	</contributor>

	

	<category

	scheme="http://www.ibm.com/xmlns/prod/sn/type"

	term="entrytemplate"

	label="Entry Template">

	</category>

	<thr:in-reply-to

	xmlns:thr="http://purl.org/syndication/thread/1.0"

	ref="urn:lsid:ibm.com:oa:793G09219C73CC5C30A4F106B852AD00012F"

	type="application/atom+xml"

	href="http://activities.dulcinea.enterprise.com/service/atom2/activitynode?

	activityNodeUuid=793G09219C73CC5C30A4F106B852AD00012F"

	source="urn:lsid:ibm.com:oa:793G09219C73CC5C30A4F106B852AD00012F">

	</thr:in-reply-to>

	<snx:activity xmlns:snx="http://www.ibm.com/xmlns/prod/sn">

	793G09219C73CC5C30A4F106B852AD00012F

	</snx:activity>

	

	<link

	rel="edit"

	type="application/atom+xml"

	href="http://activities.dulcinea.enterprise.com/service/atom2/activitynode?

	activityNodeUuid=794G09219C73CC5C30A4F106B852AD000136" >

	</link>

	<link

	rel="self"

	type="application/atom+xml"

	href="http://activities.dulcinea.enterprise.com/service/atom2/activitynode?

	activityNodeUuid=794G09219C73CC5C30A4F106B852AD000136" >

	</link>

	<link

	rel="alternate"

	type="application/xhtml+xml"

	href="http://activities.dulcinea.enterprise.com/service/html/activityentry?

	uuid=794G09219C73CC5C30A4F106B852AD000136" >

	</link>

	<link

	rel="alternate"

	type="text/html"

	href="http://activities.dulcinea.enterprise.com/service/html/activityentry?

	uuid=794G09219C73CC5C30A4F106B852AD000136" ></link>

	<snx:position xmlns:snx="http://www.ibm.com/xmlns/prod/sn">2000</snx:position>

	<snx:depth xmlns:snx="http://www.ibm.com/xmlns/prod/sn">1</snx:depth>

	

	<snx:permissions

	xmlns:snx="http://www.ibm.com/xmlns/prod/sn">none, create_activity,

	view_activity, edit_activity, delete_activity, activity_owner,

	edit_activity_tags, design_activity, edit_statements, delete_statements,

	add_members, delete_members, create_entries, edit_personal_entries,

	edit_all_entries, delete_personal_entries, delete_all_entries,

	edit_personal_entry_tags, edit_all_entry_tags, view_members

	</snx:permissions>

	<summary type="text">

	</summary>

	<snx:field

	xmlns:snx="http://www.ibm.com/xmlns/prod/sn"

	name="new link"

	fid="423G09219C73CC5C30A4F106B852AD000137"

	position="1000"

	type="link">

	<link href="" title=" "></link>

	</snx:field>

	<snx:field

	xmlns:snx="http://www.ibm.com/xmlns/prod/sn"

	name="$nodeType"

	fid="4D9G09219C73CC5C30A4F106B852AD000138"

	position="2000"

	type="text"

	hidden="true">

	<summary type="text">activities/entry</summary>

	</snx:field>

	<snx:field

	xmlns:snx="http://www.ibm.com/xmlns/prod/sn"

	name="$icon"

	fid="7E2G09219C73CC5C30A4F106B852AD00013A"

	position="3000"

	type="file"

	hidden="true">

	<link

	rel="enclosure"

	type="image/jpeg"

	href="http://activities.dulcinea.enterprise.com/service/download/

	782G09219C73CC5C30A4F106B852AD00013B/icon_Don+Quixote+Image.jpg"

	size="739"></link>

	<link

	rel="edit-media"

	type="image/jpeg"

	href="http://activities.dulcinea.enterprise.com/service/download/

	782G09219C73CC5C30A4F106B852AD00013B/icon_Don+Quixote+Image.jpg"

	size="739">

	</link>

	</snx:field>

	</entry>



HTTP Request:

POST /atom2/activity?activityUuid=793G09219C73CC5C30A4F106B852AD00012F HTTP/1.1

	Host: activities.dulcinea.enterprise.com

	Content-Type: application/atom+xml

	Authorization: Basic xxx

	Content-Length: nnn 



The following sample is an entry based on the entry template:

<entry

	xmlns="http://www.w3.org/2005/Atom"

	xmlns:snx="http://www.ibm.com/xmlns/prod/sn">

	<id>urn:lsid:ibm.com:oa:794G09219C73CC5C30A4F106B852AD000136</id>

	<title type="text">New entry from entry template test</title>

	<updated>2009-01-02T20:45:07Z</updated>

	<published>2009-01-02T20:45:07Z</published>

	<author>

	<name>donquixote@dulcinea.com</name>

	<email>donquixote@dulcinea.com</email>

	<snx:userid xmlns:snx="http://www.ibm.com/xmlns/prod/sn">

	donquixote@dulcinea.com

	</snx:userid>

	<snx:ldapid xmlns:snx="http://www.ibm.com/xmlns/prod/sn">

	177G09219C7341D31A078B4D3F1552000000

	</snx:ldapid>

	</author>

	<contributor>

	<name>donquixote@dulcinea.com</name>

	<email>donquixote@dulcinea.com</email>

	<snx:userid xmlns:snx="http://www.ibm.com/xmlns/prod/sn">

	donquixote@dulcinea.com

	</snx:userid>

	<snx:ldapid xmlns:snx="http://www.ibm.com/xmlns/prod/sn">

	177G09219C7341D31A078B4D3F1552000000

	</snx:ldapid>

	</contributor>

	

	<category

	scheme="http://www.ibm.com/xmlns/prod/sn/type"

	term="entry"

	label="Entry">

	snx:template-id="794G09219C73CC5C30A4F106B852AD000136" />

	</category>

	<thr:in-reply-to

	xmlns:thr="http://purl.org/syndication/thread/1.0"

	ref="urn:lsid:ibm.com:oa:793G09219C73CC5C30A4F106B852AD00012F"

	type="application/atom+xml"

	href="http://activities.dulcinea.enterprise.com/service/atom2/activitynode?

	activityNodeUuid=793G09219C73CC5C30A4F106B852AD00012F"

	source="urn:lsid:ibm.com:oa:793G09219C73CC5C30A4F106B852AD00012F">

	</thr:in-reply-to>

	<snx:activity xmlns:snx="http://www.ibm.com/xmlns/prod/sn">

	793G09219C73CC5C30A4F106B852AD00012F

	</snx:activity>

	

	<link

	rel="edit"

	type="application/atom+xml"

	href="http://activities.dulcinea.enterprise.com/service/atom2/activitynode?

	activityNodeUuid=794G09219C73CC5C30A4F106B852AD000136" >

	</link>

	<link

	rel="self"

	type="application/atom+xml"

	href="http://activities.dulcinea.enterprise.com/service/atom2/activitynode?

	activityNodeUuid=794G09219C73CC5C30A4F106B852AD000136" >

	</link>

	<link

	rel="alternate"

	type="application/xhtml+xml"

	href="http://activities.dulcinea.enterprise.com/service/html/activityentry?

	uuid=794G09219C73CC5C30A4F106B852AD000136" >

	</link>

	<link

	rel="alternate"

	type="text/html"

	href="http://activities.dulcinea.enterprise.com/service/html/activityentry?

	uuid=794G09219C73CC5C30A4F106B852AD000136" ></link>

	<snx:position xmlns:snx="http://www.ibm.com/xmlns/prod/sn">2000</snx:position>

	<snx:depth xmlns:snx="http://www.ibm.com/xmlns/prod/sn">1</snx:depth>

	

	<snx:permissions

	xmlns:snx="http://www.ibm.com/xmlns/prod/sn">none, create_activity,

	view_activity, edit_activity, delete_activity, activity_owner,

	edit_activity_tags, design_activity, edit_statements, delete_statements,

	add_members, delete_members, create_entries, edit_personal_entries,

	edit_all_entries, delete_personal_entries, delete_all_entries,

	edit_personal_entry_tags, edit_all_entry_tags, view_members

	</snx:permissions>

	<summary type="text">

	</summary>

	<snx:field

	xmlns:snx="http://www.ibm.com/xmlns/prod/sn"

	name="new link"

	fid="423G09219C73CC5C30A4F106B852AD000137"

	position="1000"

	type="link">

	<link href="" title=" "></link>

	</snx:field>

	<snx:field

	xmlns:snx="http://www.ibm.com/xmlns/prod/sn"

	name="$nodeType"

	fid="4D9G09219C73CC5C30A4F106B852AD000138"

	position="2000"

	type="text"

	hidden="true">

	<summary type="text">activities/entry</summary>

	</snx:field>

	<snx:field

	name="BPEntry"

	fid="241G09219577106BB17CF5E127B282000795"

	position="4000"

	type="person">

	  <name />

	  <email />

	  <snx:userid />

	</snx:field>

	</entry>