Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • SearchText
    • Type: String
    • The text to search for.
  • FilterByFoodTypes (Optional)
    • FoodType[]
    • Indicates which types of foods are returned. If empty, all foods are returned.
  • FilterByPulbicationStates (Optional)
    • PublicationState[]
    • Indicates which foods with the given publication states are returned. If empty, all foods are returned.
  • DataSourceFilter (Optional)
    • String[]
    • Indicates which sources (UserFoods / EshaFoods) to query from.  
  • 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.

...

Code Block
languagexml
titleSOAP Request
linenumberstrue
collapsetrue
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:gen="http://ns.esha.com/2013/genesisapi">
   <soap:Header/>
   <soap:Body>com/2013/genesisapi">
   <soap:Header/>
   <soap:Body>
      <gen:FoodsSearchRequest>
         <gen:DataSourceFilter>
            <gen:DataSource>UserFoods</gen:DataSource>
            <gen:DataSource>EshaFoods</gen:DataSource>
         </gen:DataSourceFilter>
         <gen:FilterByFoodTypes>
            <gen:FoodType>Recipe</gen:FoodType>
		  <gen:FoodType>Ingredient</gen:FoodType>
         </gen:FilterByFoodTypes>
         <gen:FilterByPublicationStates>
            <gen:PublicationState>Draft</gen:PublicationState>
            <gen:PublicationState>Published</gen:PublicationState>
          <gen:FoodsSearchRequest></gen:FilterByPublicationStates>
         <gen:PageSize>3</gen:PageSize>
         <gen:SearchText>chicken</gen:SearchText>
         <gen:StartIndex>1</gen:StartIndex>
      </gen:FoodsSearchRequest>
   </soap:Body>
</soap:Envelope>

...

Code Block
titleREST Request
linenumberstrue
collapsetrue
request={"SearchText":"chicken", "StartIndex":1, "PageSize":3, "FilterByPublicationStates":["Draft", "Published"], "DataSourceFilter":["UserFoods", "EshaFoods"], "FilterByFoodTypes":["Ingredient", "Recipe"]}


Code Block
titleREST Response
linenumberstrue
collapsetrue
{
    "Foods": [
        {
            "$type": "Esha.DomainModel.Serialization.IngredientDto, Esha.DomainModel.Serialization",
            "NutrientProfileIdSpecified": false,
            "FoodType": 73,
            "Name": {
                "en-US": "broth, chicken, canned"
            },
            "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-20T00:00:00.0000000",
                "UtcOffsetInMinutes": 0
            },
            "CreatedSpecified": true,
            "Modified": {
                "DateTime": "2016-06-09T23:28:00.0000000",
                "UtcOffsetInMinutes": 0
            },
            "ModifiedSpecified": true,
            "LegacyKey": 50343,
            "LegacyKeySpecified": true,
            "LegacyNutrientRefNumSpecified": false,
            "LegacyYieldKeySpecified": false,
            "UserCode": null,
            "UsdaCodeSpecified": false,
            "EshaCodeSpecified": false,
            "OwnerName": null,
            "AlternateNamesSpecified": false,
            "AllergenStatementSettingsSpecified": false,
            "IngredientStatementSettingsSpecified": false,
            "AllergenStatementsSpecified": false,
            "IngredientStatementsSpecified": false,
            "Brand": {
                "Supplier": "Del Monte Foods Company",
                "Product": "College Inn",
                "IdSpecified": false
            },
            "GroupsIdsSpecified": false,
            "NutrientTransformIdsSpecified": false,
            "ImagesSpecified": false,
            "LabelsSpecified": false,
            "AnalysisOverrides": null,
            "PropertyValues": null,
            "Id": "752eb9c2-c4a7-0000-bede-d3a51c0fdeba",
            "IdSpecified": true
        },
        {
            "$type": "Esha.DomainModel.Serialization.IngredientDto, Esha.DomainModel.Serialization",
            "NutrientProfileIdSpecified": false,
            "FoodType": 73,
            "Name": {
                "en-US": "Chicken Broccoli Seasoning"
            },
            "CommonName": null,
            "Description": null,
            "Notes": null,
            "DefiningAmount": null,
            "AmountCost": null,
            "DefaultWeightUnitIdSpecified": false,
            "ConversionMapIdSpecified": false,
            "Conversions": null,
            "ItemsSpecified": false,
            "AnalysesSpecified": false,
            "GlycemicIndex": null,
            "Created": {
                "DateTime": "2012-05-02T07:00:00.0000000",
                "UtcOffsetInMinutes": 0
            },
            "CreatedSpecified": true,
            "Modified": {
                "DateTime": "2012-05-02T07:00:00.0000000",
                "UtcOffsetInMinutes": 0
            },
            "ModifiedSpecified": true,
            "LegacyKey": 1925705578,
            "LegacyKeySpecified": true,
            "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-ef6a-72c7-bede-d3a51c0fdeba",
            "IdSpecified": true
        },
        {
            "$type": "Esha.DomainModel.Serialization.RecipeDto, Esha.DomainModel.Serialization",
            "HaccpIdsSpecified": false,
            "CookMethod": null,
            "CookTemperature": null,
            "CookTime": null,
            "Instructions": null,
            "HaccpHeadingLevelSpecified": false,
            "PanSize": null,
            "PreparationTime": null,
            "ContentClaimReferenceIdSpecified": false,
            "DefinedServingWeightConversion": null,
            "NutrientContentClaimsText": null,
            "FoodType": 82,
            "Name": {
                "en-US": "chicken soup"
            },
            "CommonName": {
                "en-US": "SLARK"
            },
            "Description": null,
            "Notes": null,
            "DefiningAmount": null,
            "AmountCost": null,
            "DefaultWeightUnitIdSpecified": false,
            "ConversionMapIdSpecified": false,
            "Conversions": null,
            "ItemsSpecified": false,
            "AnalysesSpecified": false,
            "GlycemicIndex": null,
            "Created": {
                "DateTime": "2015-10-15T20:05:00.0000000",
                "UtcOffsetInMinutes": 0
            },
            "CreatedSpecified": true,
            "Modified": {
                "DateTime": "2018-08-04T15:49:00.0000000",
                "UtcOffsetInMinutes": 0
            },
            "ModifiedSpecified": true,
            "LegacyKey": 1897542078,
            "LegacyKeySpecified": true,
            "LegacyNutrientRefNumSpecified": false,
            "LegacyYieldKeySpecified": false,
            "UserCode": "0032-000",
            "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": "8980ff36-31be-711a-5ef8-ee69ecb67fee",
            "IdSpecified": true
        }
    ],
    "Status": {
        "StatusMessage": 200,
        "StatusCode": 200,
        "StatusDetail": null
    },
    "ResponseVersion": {}
}

...