POST api/main/recommendations
The main connection to calculate Nutrient Recommendations
Request Information
Authorization is required
Response Codes
- OK (200)
- BadRequest (400)
- Unauthorized (401)
- NotFound (404)
URI Parameters
None.
Body Parameters
Input Dataset required for the connection - containing Field and Nutrient details
datainputName | Description | Type | Additional information |
---|---|---|---|
Field |
The class containing all elements relating to the field |
field |
This is a required class |
Nutrients |
The class containing all elements relating to each of the nutrients to calculate recoomendations for |
nutrients |
This is a required class |
Totals |
Boolean value used to determine whether to include a breakdown of each Recommendation value in the returned dataset. True: just return total values, False: also include the breakdown values |
boolean |
This is a required value |
Request Formats
application/json, text/json
{ "Field": { "FieldType": 1, "MultipleCrops": true, "Arable": [ { "CropGroupID": 1, "CropTypeID": 1, "CropInfo1ID": 1, "CropInfo2ID": 1, "SowingDate": "2024-11-25T07:08:39.9023948+00:00", "ExpectedYield": 1.0 }, { "CropGroupID": 1, "CropTypeID": 1, "CropInfo1ID": 1, "CropInfo2ID": 1, "SowingDate": "2024-11-25T07:08:39.9023948+00:00", "ExpectedYield": 1.0 } ], "Grassland": { "SNSID": 1, "GrassGrowthClassID": 1, "YieldTypeID": 1, "SequenceID": 1, "GrasslandSequence": [ { "Position": 1, "CropMaterialID": 1, "Yield": 1.0 }, { "Position": 1, "CropMaterialID": 1, "Yield": 1.0 } ], "EstablishedDate": "2024-11-25T07:08:39.9023948+00:00", "SeasonID": 1 }, "Soil": { "SoilTypeID": 1, "KReleasingClay": true, "NVZActionProgrammeID": 1, "SoilAnalyses": [ { "SoilAnalysisDate": "2024-11-25T07:08:39.9023948+00:00", "SoilpH": 1.0, "SulphurDeficient": true, "SNSIndexID": 1, "PIndexID": 1, "KIndexID": 1, "MgIndexID": 1, "SNSMethodologyID": 1, "PMethodologyID": 1, "KMethodologyID": 1, "MgMethodologyID": 1 }, { "SoilAnalysisDate": "2024-11-25T07:08:39.9023948+00:00", "SoilpH": 1.0, "SulphurDeficient": true, "SNSIndexID": 1, "PIndexID": 1, "KIndexID": 1, "MgIndexID": 1, "SNSMethodologyID": 1, "PMethodologyID": 1, "KMethodologyID": 1, "MgMethodologyID": 1 } ] }, "HarvestYear": 1, "Area": 1.0, "Postcode": "sample string 1", "Altitude": 1, "RainfallAverage": 1.0, "ExcessWinterRainfall": 1.0, "OrganicMaterials": [ { "MaterialID": 1, "IncorporationMethodID": 1, "ApplicationDate": "2024-11-25T07:08:39.9023948+00:00", "ApplicationRate": 1.0, "Nitrogen": 1.0, "Phosphate": 1.0, "Potash": 1.0, "Magnesium": 1.0, "Sulphur": 1.0 }, { "MaterialID": 1, "IncorporationMethodID": 1, "ApplicationDate": "2024-11-25T07:08:39.9023948+00:00", "ApplicationRate": 1.0, "Nitrogen": 1.0, "Phosphate": 1.0, "Potash": 1.0, "Magnesium": 1.0, "Sulphur": 1.0 } ], "PreviousCropping": { "PreviousGrassID": 1, "PreviousCropGroupID": 1, "PreviousCropTypeID": 1, "SNSID": 1 } }, "Nutrients": { "Nitrogen": true, "Phosphate": true, "Potash": true, "Magnesium": true, "Sodium": true, "Sulphur": true, "Lime": true }, "Totals": true }
application/xml, text/xml
<datainput xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/RB209_WebApi.Models.RecommendationInput"> <Field> <Altitude>1</Altitude> <Arable> <arable> <CropGroupID>1</CropGroupID> <CropInfo1ID>1</CropInfo1ID> <CropInfo2ID>1</CropInfo2ID> <CropTypeID>1</CropTypeID> <ExpectedYield>1</ExpectedYield> <SowingDate>2024-11-25T07:08:39.9023948+00:00</SowingDate> </arable> <arable> <CropGroupID>1</CropGroupID> <CropInfo1ID>1</CropInfo1ID> <CropInfo2ID>1</CropInfo2ID> <CropTypeID>1</CropTypeID> <ExpectedYield>1</ExpectedYield> <SowingDate>2024-11-25T07:08:39.9023948+00:00</SowingDate> </arable> </Arable> <Area>1</Area> <ExcessWinterRainfall>1</ExcessWinterRainfall> <FieldType>1</FieldType> <Grassland> <EstablishedDate>2024-11-25T07:08:39.9023948+00:00</EstablishedDate> <GrassGrowthClassID>1</GrassGrowthClassID> <GrasslandSequence> <grasslandsequence> <CropMaterialID>1</CropMaterialID> <Position>1</Position> <Yield>1</Yield> </grasslandsequence> <grasslandsequence> <CropMaterialID>1</CropMaterialID> <Position>1</Position> <Yield>1</Yield> </grasslandsequence> </GrasslandSequence> <SNSID>1</SNSID> <SeasonID>1</SeasonID> <SequenceID>1</SequenceID> <YieldTypeID>1</YieldTypeID> </Grassland> <HarvestYear>1</HarvestYear> <MultipleCrops>true</MultipleCrops> <OrganicMaterials> <organicmaterials> <ApplicationDate>2024-11-25T07:08:39.9023948+00:00</ApplicationDate> <ApplicationRate>1</ApplicationRate> <IncorporationMethodID>1</IncorporationMethodID> <Magnesium>1</Magnesium> <MaterialID>1</MaterialID> <Nitrogen>1</Nitrogen> <Phosphate>1</Phosphate> <Potash>1</Potash> <Sulphur>1</Sulphur> </organicmaterials> <organicmaterials> <ApplicationDate>2024-11-25T07:08:39.9023948+00:00</ApplicationDate> <ApplicationRate>1</ApplicationRate> <IncorporationMethodID>1</IncorporationMethodID> <Magnesium>1</Magnesium> <MaterialID>1</MaterialID> <Nitrogen>1</Nitrogen> <Phosphate>1</Phosphate> <Potash>1</Potash> <Sulphur>1</Sulphur> </organicmaterials> </OrganicMaterials> <Postcode>sample string 1</Postcode> <PreviousCropping> <PreviousCropGroupID>1</PreviousCropGroupID> <PreviousCropTypeID>1</PreviousCropTypeID> <PreviousGrassID>1</PreviousGrassID> <SNSID>1</SNSID> </PreviousCropping> <RainfallAverage>1</RainfallAverage> <Soil> <KReleasingClay>true</KReleasingClay> <NVZActionProgrammeID>1</NVZActionProgrammeID> <SoilAnalyses> <soilanalysis> <KIndexID>1</KIndexID> <KMethodologyID>1</KMethodologyID> <MgIndexID>1</MgIndexID> <MgMethodologyID>1</MgMethodologyID> <PIndexID>1</PIndexID> <PMethodologyID>1</PMethodologyID> <SNSIndexID>1</SNSIndexID> <SNSMethodologyID>1</SNSMethodologyID> <SoilAnalysisDate>2024-11-25T07:08:39.9023948+00:00</SoilAnalysisDate> <SoilpH>1</SoilpH> <SulphurDeficient>true</SulphurDeficient> </soilanalysis> <soilanalysis> <KIndexID>1</KIndexID> <KMethodologyID>1</KMethodologyID> <MgIndexID>1</MgIndexID> <MgMethodologyID>1</MgMethodologyID> <PIndexID>1</PIndexID> <PMethodologyID>1</PMethodologyID> <SNSIndexID>1</SNSIndexID> <SNSMethodologyID>1</SNSMethodologyID> <SoilAnalysisDate>2024-11-25T07:08:39.9023948+00:00</SoilAnalysisDate> <SoilpH>1</SoilpH> <SulphurDeficient>true</SulphurDeficient> </soilanalysis> </SoilAnalyses> <SoilTypeID>1</SoilTypeID> </Soil> </Field> <Nutrients> <Lime>true</Lime> <Magnesium>true</Magnesium> <Nitrogen>true</Nitrogen> <Phosphate>true</Phosphate> <Potash>true</Potash> <Sodium>true</Sodium> <Sulphur>true</Sulphur> </Nutrients> <Totals>true</Totals> </datainput>
application/x-www-form-urlencoded
Sample not available.
Response Information
Resource Description
Output Dataset returned from the connection - containing Nutrient Recommendations, Nutrients Supplied, Advice Notes and Current Version of the API
dataoutputName | Description | Type | Additional information |
---|---|---|---|
Recommendations |
Details of the Recommendation values returned |
Collection of recommendations |
None. |
NutrientsSupplied |
Details of Nutrients supplied to the field through Organic Material applications |
Collection of nutrientssupplied |
None. |
AdviceNotes |
Details of the Advice Notes returned |
Collection of advicenotes |
None. |
VersionNumber |
The version number of the API performing the calculations |
string |
None. |
Response Formats
application/json, text/json
{ "Recommendations": [ { "NutrientID": 1, "Type": "A", "SequenceID": 3, "DefoliationID": 4, "IndexpH": "sample string 5", "CropNeedValue": 1.0, "Breakdown": true, "Description": "sample string 7" }, { "NutrientID": 1, "Type": "A", "SequenceID": 3, "DefoliationID": 4, "IndexpH": "sample string 5", "CropNeedValue": 1.0, "Breakdown": true, "Description": "sample string 7" } ], "NutrientsSupplied": [ { "MaterialID": 1, "ApplicationDate": "2024-11-25T07:08:39.9023948+00:00", "NutrientID": 1, "Total": 1.0, "Available": 1.0 }, { "MaterialID": 1, "ApplicationDate": "2024-11-25T07:08:39.9023948+00:00", "NutrientID": 1, "Total": 1.0, "Available": 1.0 } ], "AdviceNotes": [ { "NutrientID": 1, "Note": "sample string 2" }, { "NutrientID": 1, "Note": "sample string 2" } ], "VersionNumber": "sample string 1" }
application/xml, text/xml
<dataoutput xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/RB209_WebApi.Models.RecommendationOutput"> <AdviceNotes> <advicenotes> <Note>sample string 2</Note> <NutrientID>1</NutrientID> </advicenotes> <advicenotes> <Note>sample string 2</Note> <NutrientID>1</NutrientID> </advicenotes> </AdviceNotes> <NutrientsSupplied> <nutrientssupplied> <ApplicationDate>2024-11-25T07:08:39.9023948+00:00</ApplicationDate> <Available>1</Available> <MaterialID>1</MaterialID> <NutrientID>1</NutrientID> <Total>1</Total> </nutrientssupplied> <nutrientssupplied> <ApplicationDate>2024-11-25T07:08:39.9023948+00:00</ApplicationDate> <Available>1</Available> <MaterialID>1</MaterialID> <NutrientID>1</NutrientID> <Total>1</Total> </nutrientssupplied> </NutrientsSupplied> <Recommendations> <recommendations> <Breakdown>true</Breakdown> <CropNeedValue>1</CropNeedValue> <DefoliationID>4</DefoliationID> <Description>sample string 7</Description> <IndexpH>sample string 5</IndexpH> <NutrientID>1</NutrientID> <SequenceID>3</SequenceID> <Type>65</Type> </recommendations> <recommendations> <Breakdown>true</Breakdown> <CropNeedValue>1</CropNeedValue> <DefoliationID>4</DefoliationID> <Description>sample string 7</Description> <IndexpH>sample string 5</IndexpH> <NutrientID>1</NutrientID> <SequenceID>3</SequenceID> <Type>65</Type> </recommendations> </Recommendations> <VersionNumber>sample string 1</VersionNumber> </dataoutput>