ListNutrients

Summary: Provides a list of all nutrients available which could be present in some quantity in foods.

Soap Action: http://ns.esha.com/2013/genesisapi/ListNutrients

Request Type: NutrientListRequest

  • 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: NutrientListResponse

  • Nutrients
    • Type: NutrientDto[]
    • List of nutrients obtained from the given request.
  • Status
    • Type: exlx:ResultStatus
    • The ResultStatus of the given response
  • ResponseVersion
    • Type: exlx:XmlVersion
    • The version of the given response.


SOAP Request
<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:NutrientListRequest>
         <gen:StartIndex>1</gen:StartIndex>
         <gen:PageSize>3</gen:PageSize>
      </gen:NutrientListRequest>
   </soap:Body>
</soap:Envelope>
SOAP Response
<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/listnutrientsresponse</a:Action>
   </s:Header>
   <s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
      <NutrientListResponse xmlns="http://ns.esha.com/2013/genesisapi">
         <Nutrients>
            <Nutrient>
               <Id xmlns="http://ns.esha.com/2013/exlx">84a8709a-0000-0000-ebf9-90cea7d9d44f</Id>
               <Name xmlns="http://ns.esha.com/2013/exlx">
                  <Value xml:lang="en-US" xmlns="http://ns.esha.com/2013/types">Calories</Value>
               </Name>
               <LegacyKey xmlns="http://ns.esha.com/2013/exlx">0</LegacyKey>
               <StandardKey xmlns="http://ns.esha.com/2013/exlx">Calories</StandardKey>
               <IsScalar xmlns="http://ns.esha.com/2013/exlx">true</IsScalar>
            </Nutrient>
            <Nutrient>
               <Id xmlns="http://ns.esha.com/2013/exlx">84a8709a-0001-0000-ebf9-90cea7d9d44f</Id>
               <Name xmlns="http://ns.esha.com/2013/exlx">
                  <Value xml:lang="en-US" xmlns="http://ns.esha.com/2013/types">Protein</Value>
               </Name>
               <UnitId xmlns="http://ns.esha.com/2013/exlx">a7df0af5-0008-0000-7484-751e8eaf05c6</UnitId>
               <LegacyKey xmlns="http://ns.esha.com/2013/exlx">1</LegacyKey>
               <StandardKey xmlns="http://ns.esha.com/2013/exlx">Protein</StandardKey>
               <IsScalar xmlns="http://ns.esha.com/2013/exlx">true</IsScalar>
            </Nutrient>
            <Nutrient>
               <Id xmlns="http://ns.esha.com/2013/exlx">84a8709a-0002-0000-ebf9-90cea7d9d44f</Id>
               <Name xmlns="http://ns.esha.com/2013/exlx">
                  <Value xml:lang="en-US" xmlns="http://ns.esha.com/2013/types">Carbohydrates</Value>
               </Name>
               <UnitId xmlns="http://ns.esha.com/2013/exlx">a7df0af5-0008-0000-7484-751e8eaf05c6</UnitId>
               <LegacyKey xmlns="http://ns.esha.com/2013/exlx">2</LegacyKey>
               <StandardKey xmlns="http://ns.esha.com/2013/exlx">Carbohydrates</StandardKey>
               <IsScalar xmlns="http://ns.esha.com/2013/exlx">true</IsScalar>
            </Nutrient>
         </Nutrients>
         <ResponseVersion>1.0.0.0</ResponseVersion>
         <Status>
            <StatusMessage>Ok</StatusMessage>
            <StatusCode>200</StatusCode>
         </Status>
      </NutrientListResponse>
   </s:Body>
</s:Envelope>
REST Request
POST http://localhost:80/rest/FoodQueryService.svc/ListNutrients HTTP/1.1
Content-Type: text/plain
Host: localhost:80

request={"StartIndex":1, "PageSize":3}
REST Response
{
    "Nutrients": [
        {
            "Name": {
                "en-US": "Calories"
            },
            "UnitIdSpecified": false,
            "LegacyKey": 0,
            "LegacyKeySpecified": true,
            "StandardKey": 0,
            "StandardKeySpecified": true,
            "IsScalar": true,
            "PrecisionSpecified": false,
            "Id": "84a8709a-0000-0000-ebf9-90cea7d9d44f",
            "IdSpecified": true
        },
        {
            "Name": {
                "en-US": "Protein"
            },
            "UnitId": "a7df0af5-0008-0000-7484-751e8eaf05c6",
            "UnitIdSpecified": true,
            "LegacyKey": 1,
            "LegacyKeySpecified": true,
            "StandardKey": 1,
            "StandardKeySpecified": true,
            "IsScalar": true,
            "PrecisionSpecified": false,
            "Id": "84a8709a-0001-0000-ebf9-90cea7d9d44f",
            "IdSpecified": true
        },
        {
            "Name": {
                "en-US": "Carbohydrates"
            },
            "UnitId": "a7df0af5-0008-0000-7484-751e8eaf05c6",
            "UnitIdSpecified": true,
            "LegacyKey": 2,
            "LegacyKeySpecified": true,
            "StandardKey": 2,
            "StandardKeySpecified": true,
            "IsScalar": true,
            "PrecisionSpecified": false,
            "Id": "84a8709a-0002-0000-ebf9-90cea7d9d44f",
            "IdSpecified": true
        }
    ],
    "Status": {
        "StatusMessage": 200,
        "StatusCode": 200,
        "StatusDetail": null
    },
    "ResponseVersion": {}
}