SearchByGroup
- Nate Edwards
- Patrick Murphy
- Alex Caroline
Owned by Nate Edwards
Summary:Â Searches foods returning those which belong to a group with the supplied name.
Soap Action: http://ns.esha.com/2013/genesisapi/SearchByGroup
Request Type: FoodsByGroupRequest
- GroupName
- Type: String
- The group used to select the list of foods.
- FilterByFoodTypes (Optional)
- FoodType[]
- Indicates which types of foods are returned. If empty, all foods are returned.
- DataSourceFilter (Optional)
- String[]
- Indicates which sources (UserFoods / EshaFoods) to query from.
- FilterByPulbicationStates (Optional)
- PublicationState[]
- Indicates which foods with the given publication states are returned. If empty, only published foods are returned.
- StartIndex (Optional)
- Type: Int
- The index offset. If empty, index starts at 1.
- PageSize (Optional)
- Type: Int
- The number of foods to return in the response. If empty, all records are returned.
Response Type: FoodsListResponse
- Foods
- Type: FoodDto[]
- The list of foods obtained from the request.
- Status
- Type: exlx:ResultStatus
- The ResultStatus of the given response
- ResponseVersion
- Type: exlx:XmlVersion
- The version of the given response.
SOAP Request Expand source
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:gen="http://ns.esha.com/2013/genesisapi"> <soap:Header/> <soap:Body> <gen:FoodsByGroupRequest> <gen:FilterByFoodTypes> <gen:FoodType>Recipe</gen:FoodType> <gen:FoodType>Ingredient</gen:FoodType> </gen:FilterByFoodTypes> <gen:DataSourceFilter> <gen:DataSource>UserFoods</gen:DataSource> <gen:DataSource>EshaFoods</gen:DataSource> </gen:DataSourceFilter> <gen:FilterByPublicationStates> <gen:PublicationState>Published</gen:PublicationState> <gen:PublicationState>Draft</gen:PublicationState> </gen:FilterByPublicationStates> <gen:GroupName>Egg Free</gen:GroupName> <gen:PageSize>3</gen:PageSize> <gen:StartIndex>1</gen:StartIndex> </gen:FoodsByGroupRequest> </soap:Body> </soap:Envelope>
SOAP Response Expand source
<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:a="http://www.w3.org/2005/08/addressing"> <s:Header> <a:Action s:mustUnderstand="1">http://ns.esha.com/2013/genesisapi/searchbygroupresponse</a:Action> </s:Header> <s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <FoodsListResponse xmlns="http://ns.esha.com/2013/genesisapi"> <Foods> <Ingredient> <Id xmlns="http://ns.esha.com/2013/exlx">752eb9c2-01ff-0000-bede-d3a51c0fdeba</Id> <Name xmlns="http://ns.esha.com/2013/exlx"> <Value xml:lang="en-US" xmlns="http://ns.esha.com/2013/types">Cream, whipping, light</Value> </Name> <Created xmlns="http://ns.esha.com/2013/exlx"> <DateTime xmlns="http://ns.esha.com/2013/types">1999-03-20T08:00:00.0000000</DateTime> <UtcOffsetInMinutes xmlns="http://ns.esha.com/2013/types">-480</UtcOffsetInMinutes> </Created> <Modified xmlns="http://ns.esha.com/2013/exlx"> <DateTime xmlns="http://ns.esha.com/2013/types">2015-05-19T00:26:00.0000000</DateTime> <UtcOffsetInMinutes xmlns="http://ns.esha.com/2013/types">-420</UtcOffsetInMinutes> </Modified> </Ingredient> <Ingredient> <Id xmlns="http://ns.esha.com/2013/exlx">752eb9c2-0200-0000-bede-d3a51c0fdeba</Id> <Name xmlns="http://ns.esha.com/2013/exlx"> <Value xml:lang="en-US" xmlns="http://ns.esha.com/2013/types">cream, whipping, whipped, light</Value> </Name> <Created xmlns="http://ns.esha.com/2013/exlx"> <DateTime xmlns="http://ns.esha.com/2013/types">1999-03-20T08:00:00.0000000</DateTime> <UtcOffsetInMinutes xmlns="http://ns.esha.com/2013/types">-480</UtcOffsetInMinutes> </Created> <Modified xmlns="http://ns.esha.com/2013/exlx"> <DateTime xmlns="http://ns.esha.com/2013/types">2015-05-19T00:26:00.0000000</DateTime> <UtcOffsetInMinutes xmlns="http://ns.esha.com/2013/types">-420</UtcOffsetInMinutes> </Modified> </Ingredient> <Ingredient> <Id xmlns="http://ns.esha.com/2013/exlx">752eb9c2-0383-0000-bede-d3a51c0fdeba</Id> <Name xmlns="http://ns.esha.com/2013/exlx"> <Value xml:lang="en-US" xmlns="http://ns.esha.com/2013/types">strawberries, freeze dried, diced, 3/8"</Value> </Name> <Created xmlns="http://ns.esha.com/2013/exlx"> <DateTime xmlns="http://ns.esha.com/2013/types">1999-03-19T15:00:00.0000000</DateTime> <UtcOffsetInMinutes xmlns="http://ns.esha.com/2013/types">-480</UtcOffsetInMinutes> </Created> <Modified xmlns="http://ns.esha.com/2013/exlx"> <DateTime xmlns="http://ns.esha.com/2013/types">1999-03-19T15:00:00.0000000</DateTime> <UtcOffsetInMinutes xmlns="http://ns.esha.com/2013/types">-480</UtcOffsetInMinutes> </Modified> </Ingredient> </Foods> <ResponseVersion>1.0.0.0</ResponseVersion> <Status> <StatusMessage>Ok</StatusMessage> <StatusCode>200</StatusCode> </Status> </FoodsListResponse> </s:Body> </s:Envelope>
REST Request Expand source
POST http://localhost:80/rest/FoodQueryService.svc/SearchByGroup HTTP/1.1 Content-Type: text/plain Host: localhost:80 request={"GroupName":"Egg Free", "StartIndex":1, "PageSize":3, "FilterByPublicationStates":["Draft", "Published"], "DataSourceFilter":["UserFoods", "EshaFoods"], "FilterByFoodTypes":["Ingredient", "Recipe"]}
REST Response Expand source
{ "Foods": [ { "$type": "Esha.DomainModel.Serialization.IngredientDto, Esha.DomainModel.Serialization", "NutrientProfileIdSpecified": false, "FoodType": 73, "Name": { "en-US": "Cream, whipping, light" }, "CommonName": null, "Description": null, "Notes": null, "DefiningAmount": null, "AmountCost": null, "DefaultWeightUnitIdSpecified": false, "ConversionMapIdSpecified": false, "Conversions": null, "ItemsSpecified": false, "AnalysesSpecified": false, "GlycemicIndex": null, "Created": { "DateTime": "1999-03-20T08:00:00.0000000", "UtcOffsetInMinutes": -480 }, "CreatedSpecified": true, "Modified": { "DateTime": "2015-05-19T00:26:00.0000000", "UtcOffsetInMinutes": -420 }, "ModifiedSpecified": true, "LegacyKeySpecified": false, "LegacyNutrientRefNumSpecified": false, "LegacyYieldKeySpecified": false, "UserCode": null, "UsdaCodeSpecified": false, "EshaCodeSpecified": false, "OwnerName": null, "AlternateNamesSpecified": false, "AllergenStatementSettingsSpecified": false, "IngredientStatementSettingsSpecified": false, "AllergenStatementsSpecified": false, "IngredientStatementsSpecified": false, "Brand": null, "GroupsIdsSpecified": false, "NutrientTransformIdsSpecified": false, "ImagesSpecified": false, "LabelsSpecified": false, "AnalysisOverrides": null, "PropertyValues": null, "Id": "752eb9c2-01ff-0000-bede-d3a51c0fdeba", "IdSpecified": true }, { "$type": "Esha.DomainModel.Serialization.IngredientDto, Esha.DomainModel.Serialization", "NutrientProfileIdSpecified": false, "FoodType": 73, "Name": { "en-US": "cream, whipping, whipped, light" }, "CommonName": null, "Description": null, "Notes": null, "DefiningAmount": null, "AmountCost": null, "DefaultWeightUnitIdSpecified": false, "ConversionMapIdSpecified": false, "Conversions": null, "ItemsSpecified": false, "AnalysesSpecified": false, "GlycemicIndex": null, "Created": { "DateTime": "1999-03-20T08:00:00.0000000", "UtcOffsetInMinutes": -480 }, "CreatedSpecified": true, "Modified": { "DateTime": "2015-05-19T00:26:00.0000000", "UtcOffsetInMinutes": -420 }, "ModifiedSpecified": true, "LegacyKeySpecified": false, "LegacyNutrientRefNumSpecified": false, "LegacyYieldKeySpecified": false, "UserCode": null, "UsdaCodeSpecified": false, "EshaCodeSpecified": false, "OwnerName": null, "AlternateNamesSpecified": false, "AllergenStatementSettingsSpecified": false, "IngredientStatementSettingsSpecified": false, "AllergenStatementsSpecified": false, "IngredientStatementsSpecified": false, "Brand": null, "GroupsIdsSpecified": false, "NutrientTransformIdsSpecified": false, "ImagesSpecified": false, "LabelsSpecified": false, "AnalysisOverrides": null, "PropertyValues": null, "Id": "752eb9c2-0200-0000-bede-d3a51c0fdeba", "IdSpecified": true }, { "$type": "Esha.DomainModel.Serialization.IngredientDto, Esha.DomainModel.Serialization", "NutrientProfileIdSpecified": false, "FoodType": 73, "Name": { "en-US": "strawberries, freeze dried, diced, 3/8\"" }, "CommonName": null, "Description": null, "Notes": null, "DefiningAmount": null, "AmountCost": null, "DefaultWeightUnitIdSpecified": false, "ConversionMapIdSpecified": false, "Conversions": null, "ItemsSpecified": false, "AnalysesSpecified": false, "GlycemicIndex": null, "Created": { "DateTime": "1999-03-19T15:00:00.0000000", "UtcOffsetInMinutes": -480 }, "CreatedSpecified": true, "Modified": { "DateTime": "1999-03-19T15:00:00.0000000", "UtcOffsetInMinutes": -480 }, "ModifiedSpecified": true, "LegacyKeySpecified": false, "LegacyNutrientRefNumSpecified": false, "LegacyYieldKeySpecified": false, "UserCode": null, "UsdaCodeSpecified": false, "EshaCodeSpecified": false, "OwnerName": null, "AlternateNamesSpecified": false, "AllergenStatementSettingsSpecified": false, "IngredientStatementSettingsSpecified": false, "AllergenStatementsSpecified": false, "IngredientStatementsSpecified": false, "Brand": null, "GroupsIdsSpecified": false, "NutrientTransformIdsSpecified": false, "ImagesSpecified": false, "LabelsSpecified": false, "AnalysisOverrides": null, "PropertyValues": null, "Id": "752eb9c2-0383-0000-bede-d3a51c0fdeba", "IdSpecified": true } ], "Status": { "StatusMessage": 200, "StatusCode": 200, "StatusDetail": null }, "ResponseVersion": {} }