Version: 2011.01.25

Krames StayWell External Web Service Documentation

GetCollectionContents Method

This Method returns the hierarchy of a single collection, and can optionally include the content objects belonging to each subtopic within that collection.

Parameters: XmlRequest
			<CollectionContents SubtopicId="[CollectionID]" IncludeContent="[true, false]" IncludeBlocked="[true, false]"
				IsRecursive="[true, false]" GetOriginal="[true, false]" LanguageCode="[en, es, etc]" 
				GenderCode="[A, M, F]" MaxContent="[int > 0]">
				<AgeBins>
					<AgeBin>Infant (0 - 11 mo)</AgeBin>
					<AgeBin>Childhood (11 mo - 12 yrs)</AgeBin>
					<AgeBin>Adult (18+)</AgeBin>
					<AgeBin>Senior</AgeBin>
				</AgeBins>
			</CollectionContents>
		

The SubtopicId attribute in the CollectionContents element is the only required attribute. If supplied, IncludeContent will return a list of content objects belonging to the subtopic it is related to. If the IsRecursive attribute is set to "true", all subtopics of the collection will be returned. If the GetOriginal attribute is set to “true” all content objects with custom versions will be replaced with the original version, custom version is returned by default if applicable.

The LanguageCode, Gender, and MaxContent attributes, along with the AgeBins element, are optional. If included they will filter the content object results within the subtopics based on the values supplied. They are inclusive, so if you specify a GenderCode and a LanguageCode, only content objects matching both values will be returned in the XML.

The MaxContent attribute will return a random subset of the content objects in each Subtopic returned, up to [MaxContent] per Subtopic. If the value of MaxContent is greater than the total number of content objects in the Subtopic, or the IncludeContent attribute is not set to "true", the MaxContent attribute is ignored.

Gender and AgeBins are now included in the returned XML as well.

The content objects in each subtopic's content list will be in the order defined by the collection's creator. All subtopics will be listed even if they do not contain content objects or all content objects are filtered out.

Sample Request

http://external.ws.staywell.com/[SiteName]/Content.svc/GetCollectionContents?xmlRequest=<CollectionContents SubtopicId="37683" IncludeContent="false" IncludeBlocked="false" IsRecursive="true" GetOriginal="true" />

Sample Result XML

<?xml version="1.0" encoding="utf-8" ?> 
<Subtopic SubtopicId="37683">
	<Name>Topic 1.0</Name> 
	<SubtopicList SubtopicId="37686">
		<Name>Topic 1.1</Name>
		<SubtopicList SubtopicId="37687">
			<Name>Topic 1.1.1</Name>
		</SubtopicList>
	</SubtopicList>
	<SubtopicList SubtopicId="37688">
		<Name>Topic 2.1</Name>
	</SubtopicList>
</Subtopic>