Version: 2011.01.25

Krames StayWell External Web Service Documentation

This method has been deprecated.
Use the new GetCollectionContents() method instead.

GetCollectionContents Method

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

Parameter names: XMLRequest
Expects an XML document in this format:

<CollectionContents SubtopicId="[CollectionID]" IncludeDocuments="[true, false]" IncludeBlocked="[true, false]" Recursive="[true, false]" 
		ReturnCustom="[true, false]" LanguageCode="[en, es, etc]" GenderCode="[A, M, F]" MaxDocuments="[int > 0]">
		<AgeBins>
				<AgeBin>[Adult]</AgeBin>
				<AgeBin>[Senior, etc]</AgeBin>
		</AgeBins>
</CollectionContents>

Sample Request

http://external.ws.staywell.com/[SiteName]/Collections.svc/GetCollectionContents?XmlRequest=<CollectionContents SubtopicId="3" IncludeDocuments="true" IncludeBlocked="true" Recursive="true" ReturnCustom="false"/>

The SubtopicId attribute in the CollectionContents element is the only required attribute. If supplied, IncludeDocuments will return a list of documents belonging to the subtopic it is related to. If the Recursive attribute is set to “true”, all subtopics of the collection will be returned. If the ReturnCustom attribute is set to “true”, all documents with custom versions will be replaced with the custom version.

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

The MaxDocuments attribute will return a random subset of the documents in the requested subtopic, up to [MaxDocuments]. If the value of MaxDocuments is greater than the total number of documents in the subtopic or the IncludeDocuments attribute is not set to true, this attribute is ignored. The structure of the subtopic is maintained; in the event that child subtopics are left empty by this attribute, the empty subtopic is returned anyway.

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

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

Sample Request XML:

<CollectionContents SubtopicId="3" IncludeDocuments="true" IncludeBlocked="true" Recursive="true" 
		ReturnCustom="false" LanguageCode="en" GenderCode="A" MaxDocuments="5">
		<AgeBins> 
				<AgeBin>Adult (18+)</AgeBin>
		</AgeBins>
</CollectionContents>

Sample Response XML:

<?xml version="1.0" encoding="utf-8"?>
<Subtopic SubtopicId="2" xmlns="http://ws.staywell.com">
	<Name>HealthInk</Name>
	<SubtopicList>
		<Subtopic SubtopicId="5">
			<Name>HI 2</Name>
			<DocumentList>
				<Document ContentTypeId="8" ContentId="AssessCoronary" IsCustom="0">
					<Language code="en">English</Language>
					<RegularTitle xmlns="http://ws.staywell.com/markup">Coronary Heart Disease Risk Assessment</RegularTitle>
					<GenderCode>A</GenderCode>
					<AdditionalTitles/>
					<AgeBins>
						<AgeBin>Adult (18+)</AgeBin>
					</AgeBins>
				</Document>
				<Document ContentTypeId="6" ContentId="519282" IsCustom="0">
					<Language code="en">English</Language>
					<RegularTitle xmlns="http://ws.staywell.com/markup">
						<i>Health <b>Tip</b>:</i> Finger Sprains</RegularTitle>
					<GenderCode>A</GenderCode>
					<AdditionalTitles/>
					<AgeBins>
						<AgeBin>Adult (18+)</AgeBin>
					</AgeBins>
				</Document>
			</DocumentList>
		</Subtopic>
	</SubtopicList>
	<DocumentList>
		<Document ContentTypeId="2" ContentId="backpain" IsCustom="0">
			<Language code="en">English</Language>
			<RegularTitle xmlns="http://ws.staywell.com/markup">Back Pain</RegularTitle>
			<AdditionalTitles>
				<AdditionalTitle xmlns="http://ws.staywell.com/markup">Acute Sciatica</AdditionalTitle>
			<GenderCode>A</GenderCode>
			</AdditionalTitles>
			<AgeBins>
				<AgeBin>Adult (18+)</AgeBin>
			</AgeBins>
		</Document>
		<Document ContentTypeId="2" ContentId="exercise" IsCustom="0">
			<Language code="en">English</Language>
			<RegularTitle xmlns="http://ws.staywell.com/markup" > Exercise</RegularTitle>
			<GenderCode>A</GenderCode>
			<AdditionalTitles/>
			<AgeBins>
				<AgeBin>Adult (18+)</AgeBin>
			</AgeBins>
		</Document>
	</DocumentList>
</Subtopic>