PhytClean Web API

Download The PDF #

PhytClean Web API V1.11 – (2020-10-08)

What Is PhytClean Web API #

The PhytClean Web API gives authenticated users access to retrieve data that was captured on the PhytClean front end as well as push data to the PhytClean database. To successfully pull or push data using this API you have to be a registered user. All data is sent via a secure channel.

How To Connect #

Once you register as a user you will receive a unique username and password from PhytClean. This username and password must be used in the code below. This example shows you how to connect to the API. If you have successfully connected to the API then you will receive a token which you can then pass to the available methods and retrieve data. If, however, your authentication has failed you will not be able to retrieve any data.

Text Box

How To Get A Dataset #

We deliver data via two responses namely XML and JSON. The examples below illustrate how to get data in each of these response types.

In XML: #

Gets the status of all citrus orchards for the last 60 minutes and returns them in XML. 

Text Box

In JSON: #

Gets the status of all citrus orchards for the last 60 minutes and returns them in JSON.

Text Box

Methods Available #

StandardPhytodata #

Description:

This endpoint will return all data relevant for PUC and Orchards for its respective sector. Response data will be GZip Encoded (Content-Encoding: gzip) – the response will need to be decoded on client-side.

Type of Request: POST
URL: https://www.phytclean.co.za/api/standardphytodata
Datatype: x-www-form-urlencoded

Required Parameters:

  • seasonID

Optional Parameters:

  • minutes (int)
  • serverTime (DateTime)
  • controlPointGroupID (int)
  • fboXML (xml)
Sample xml:  
<?xml version="1.0"?> 
   <Request> 
<Fbo> 
     <FboCode>FBOCODE GOES HERE</FboCode> 
</Fbo> 
(...add new FBOs) 
   </Request> 
  • outputType (string)

Two output type options are available i.e. ‘JSON’ and ‘XML’.

NB: The default output/response type is XML if not explicitly specified in the ‘outputType’ parameter.

Parameter Descriptions:

  • Passing seasonID only: Returns all parameters and values based on specific ControlPointGroups (Refer to Season’s endpoint: Gets a list of SeasonIDs)
  • Passing seasonID and minutes: Returns parameters and values based on specific ControlPointGroups for the last x minutes
  • Passing seasonID and serverTime: Returns parameters and values based on specific ControlPointGroups that were updated after the server time that was specified.
  • Passing seasonID and controlPointGroupID: Returns parameters and values based on ControlPointGroupID that was specified.
  • Passing seasonID and fboXML: Returns parameters and values based on specific ControlPointGroups for FBO’s that were specified.
  • Passing seasonID and outputType: Returns parameters and values in the specified outputType.


Sample XML Response (decoded)

<standardPhytoData> 

    <season seasonName="CITRUS 2018-2019" seasonStartDate="2018-09-01T00:00:00" seasonEndDate="2019-12-01T00:00:00"> 

        <fbo code="T54321"> 
            <orchard name="TEST1D" cultivarCode="BSS"> 
                <calculateddata> 

                    <cd name="phytoData" value="EUB3B3FY" /> 

                    <cd name="isCultivarB" value="true" /> 

                </calculateddata> 

                <controlpointgroups> 

                    <cpg name="cbs"> 

                        <controlpoints> 

                            <cp name="cbs_o_i"> 

                                <params> 

                                    <p name="cbs_o_i_x" value="TRUE" /> 

                                    <p name="cbs_o_i_d" value="2019/03/16" /> 

                                    <p name="cbs_o_i_r" value="PQITEST1DA" /> 

                                </params> 

                            </cp> 

                            <cp name="cbs_o_e"> 

                                <params> 

                                    <p name="cbs_o_e_x" value="NA" /> 

                                </params> 

                            </cp> 

                            <cp name="cbs_o_l"> 

                                <params> 

                                    <p name="cbs_o_l_x" value="NO LISTING" /> 

                                    <p name="cbs_o_l_d" value="" /> 

                                </params> 

                            </cp> 

                            <cp name="cbs_o_a"> 

                                <params> 

                                    <p name="cbs_o_a_x" value="false" /> 

                                </params> 

                            </cp> 

                        </controlpoints> 

                    </cpg> 

                    <cpg name="eu_reg"> 

                        <controlpoints> 

                            <cp name="euap_o"> 

                                <params> 

                                    <p name="euap_o" value="true" /> 

                                </params> 

                            </cp> 

                            <cp name="euve_o"> 

                                <params> 

                                    <p name="euve_o" value="PENDING" /> 

                                </params> 

                            </cp> 

                        </controlpoints> 

                    </cpg> 

                    <cpg name="ir_reg"> 

                        <controlpoints> 

                            <cp name="irap_o"> 

                                <params> 

                                    <p name="irap_o" value="FALSE" /> 

                                </params> 

                            </cp> 

                            <cp name="irve_o"> 

                                <params> 

                                    <p name="irve_o" value="FALSE" /> 

                                </params> 

                            </cp> 

                        </controlpoints> 

                    </cpg> 

                    <cpg name="ja_reg"> 

                        <controlpoints> 

                            <cp name="jaap_o"> 

                                <params> 

                                    <p name="jaap_o" value="FALSE" /> 

                                </params> 

                            </cp> 

                        </controlpoints> 

                    </cpg> 

                    <cpg name="us_reg"> 

                        <controlpoints> 

                            <cp name="usap_o"> 

                                <params> 

                                    <p name="usap_o" value="FALSE" /> 

                                </params> 

                            </cp> 

                            <cp name="usve_o"> 

                                <params> 

                                    <p name="usve_o" value="PENDING" /> 

                                </params> 

                            </cp> 

                        </controlpoints> 

                    </cpg> 

                    <cpg name="pr_reg"> 

                        <controlpoints> 

                            <cp name="prap_o"> 

                                <params> 

                                    <p name="prap_o" value="TRUE" /> 

                                </params> 

                            </cp> 

                            <cp name="prve_o"> 

                                <params> 

                                    <p name="prve_o" value="FALSE" /> 

                                </params> 

                            </cp> 

                        </controlpoints> 

                    </cpg> 

                    <cpg name="sk_reg"> 

                        <controlpoints> 

                            <cp name="skap_o"> 

                                <params> 

                                    <p name="skap_o" value="FALSE" /> 

                                </params> 

                            </cp> 

                            <cp name="skve_o"> 

                                <params> 

                                    <p name="skve_o" value="FALSE" /> 

                                </params> 

                            </cp> 

                        </controlpoints> 

                    </cpg> 

                    <cpg name="th_reg"> 

                        <controlpoints> 

                            <cp name="thap_o"> 

                                <params> 

                                    <p name="thap_o" value="FALSE" /> 

                                </params> 

                            </cp> 

                            <cp name="thve_o"> 

                                <params> 

                                    <p name="thve_o" value="FALSE" /> 

                                </params> 

                            </cp> 

                        </controlpoints> 

                    </cpg> 

                    <cpg name="bdc"> 

                        <controlpoints> 

                            <cp name="bd_p"> 

                                <params> 

                                    <p name="bd_p_x" value="TRUE" /> 

                                    <p name="bd_p_n" value="Test1234" /> 

                                </params> 

                            </cp> 

                        </controlpoints> 

                    </cpg> 

                    <cpg name="fms"> 

                        <controlpoints> 

                            <cp name="fms_o_e"> 

                                <params> 

                                    <p name="fms_o_e_x" value="ALL AVAILABLE" /> 

                                </params> 

                            </cp> 

                            <cp name="fms_p1"> 

                                <params> 

                                    <p name="fms_p1_d" value="2019/02/25" /> 

                                </params> 

                            </cp> 

                            <cp name="fms_o_p"> 

                                <params> 

                                    <p name="fms_o_p_x" value="1000-0" /> 

                                </params> 

                            </cp> 

                            <cp name="fms_o_ox"> 

                                <params> 

                                    <p name="fms_o_o_x" value="B3" /> 

                                    <p name="fms_o_o_d" value="" /> 

                                </params> 

                            </cp> 

                            <cp name="fms_p2"> 

                                <params> 

                                    <p name="fms_p2_d" value="" /> 

                                </params> 

                            </cp> 

                            <cp name="fms_o_cx"> 

                                <params> 

                                    <p name="fms_o_c_x" value="B3" /> 

                                    <p name="fms_o_c_d" value="" /> 

                                </params> 

                            </cp> 

                        </controlpoints> 

                    </cpg> 

                    <cpg name="ph_reg"> 

                        <controlpoints> 

                            <cp name="phap_o"> 

                                <params> 

                                    <p name="phap_o" value="FALSE" /> 

                                </params> 

                            </cp> 

                            <cp name="phve_o"> 

                                <params> 

                                    <p name="phve_o" value="FALSE" /> 

                                </params> 

                            </cp> 

                        </controlpoints> 

                    </cpg> 

                </controlpointgroups> 

            </orchard> 

        </fbo> 

    </season> 

</standardPhytoData> 

Sample AJAX call (certain browsers will decode gzip response):

 
<script> 

    $(document).ready(function () { 

        var jwt; 

        var tokenUrl = "https://www.phytclean.co.za/api/oauth2/token"; 

        var dataUrl = "https://www.phytclean.co.za/api/standardphytodata"; 

        var obj = { 

username: 'demoUser', 

              password: '@71dE3OU53r', 

              grant_type: 'password' 

        }; 

        var seasonID = 6; 

        var minutes = 360; 

        $.ajax({ 

            // Get authentication token 

            url: tokenUrl, 

            type: 'POST', 

            dataType: 'json', 

            contentType: 'application/x-www-form-urlencoded; charset=UTF-8', 

            data: obj, 

            success: function (data, textStatus, xhr) { 

                jwt = data.access_token; 

                // Get API Data 

                $.ajax({ 

                    url: dataUrl, 

                    type: 'POST', 

                    dataType: 'text/plain', 

                    contentType: 'application/x-www-form-urlencoded', 

                    data: { 

                        'seasonID': seasonID, 

                        'minutes': minutes, 

                        'outputType': 'xml' OPTIONAL PARAMETER (can be omitted) 

                    }, 

                    headers: { 

                        'Authorization': 'bearer ' + jwt 

                    }, 

                    success: function (data) { 

                        console.log(data); 

                    }, 

                    error: function (xhrXmlHttpRequest, textStatus, errorThrown) { 

                        console.log('Error in Operation'); 

                    } 

                }); 

            }, 

            error: function (xhrXmlHttpRequest, textStatus, errorThrown) { 

                console.log('Error in Operation'); 

            } 

        }); 

    }); 

</script> 

Sample JSON Response (decoded)

{"season":{"seasonName":"CITRUS 2018-2019","seasonStartDate":"2018-09-01T00:00:00","seasonEndDate":"2019-12-01T00:00:00","fbo":[{"code":"T12345","orchard":[{"name":"S1","cultivarCode":"EUR","calculateddata":[{"cd":[{"name":"phytoData","value":"EUNANAFY"},{"name":"isCultivarB","value":"false"}]}],"controlpointgroups":[{"cpg":[{"name":"cbs","controlpoints":[{"cp":[{"name":"cbs_o_i","params":[{"p":[{"name":"cbs_o_i_x","value":"DUE"},{"name":"cbs_o_i_d","value":""},{"name":"cbs_o_i_r","value":""}]}]},{"name":"cbs_o_e","params":[{"p":[{"name":"cbs_o_e_x","value":"NA"}]}]},{"name":"cbs_o_l","params":[{"p":[{"name":"cbs_o_l_x","value":"NO LISTING"},{"name":"cbs_o_l_d","value":""}]}]},{"name":"cbs_o_a","params":[{"p":[{"name":"cbs_o_a_x","value":"FALSE"}]}]}]}]},{"name":"eu_reg","controlpoints":[{"cp":[{"name":"euap_o","params":[{"p":[{"name":"euap_o","value":"true"}]}]},{"name":"euve_o","params":[{"p":[{"name":"euve_o","value":"PENDING"}]}]}]}]},{"name":"ir_reg","controlpoints":[{"cp":[{"name":"irap_o","params":[{"p":[{"name":"irap_o","value":"FALSE"}]}]},{"name":"irve_o","params":[{"p":[{"name":"irve_o","value":"FALSE"}]}]}]}]},{"name":"ja_reg","controlpoints":[{"cp":[{"name":"jaap_o","params":[{"p":[{"name":"jaap_o","value":"FALSE"}]}]}]}]},{"name":"us_reg","controlpoints":[{"cp":[{"name":"usap_o","params":[{"p":[{"name":"usap_o","value":"FALSE"}]}]},{"name":"usve_o","params":[{"p":[{"name":"usve_o","value":"PENDING"}]}]}]}]},{"name":"pr_reg","controlpoints":[{"cp":[{"name":"prap_o","params":[{"p":[{"name":"prap_o","value":"TRUE"}]}]},{"name":"prve_o","params":[{"p":[{"name":"prve_o","value":"FALSE"}]}]}]}]},{"name":"sk_reg","controlpoints":[{"cp":[{"name":"skap_o","params":[{"p":[{"name":"skap_o","value":"FALSE"}]}]},{"name":"skve_o","params":[{"p":[{"name":"skve_o","value":"FALSE"}]}]}]}]},{"name":"th_reg","controlpoints":[{"cp":[{"name":"thap_o","params":[{"p":[{"name":"thap_o","value":"FALSE"}]}]},{"name":"thve_o","params":[{"p":[{"name":"thve_o","value":"FALSE"}]}]}]}]},{"name":"bdc","controlpoints":[{"cp":[{"name":"bd_p","params":[{"p":[{"name":"bd_p_x","value":"NOT REQUIRED"},{"name":"bd_p_n","value":""}]}]}]}]},{"name":"fms","controlpoints":[{"cp":[{"name":"fms_o_e","params":[{"p":[{"name":"fms_o_e_x","value":"ALL AVAILABLE"}]}]},{"name":"fms_p1","params":[{"p":[{"name":"fms_p1_d","value":""}]}]},{"name":"fms_o_p","params":[{"p":[{"name":"fms_o_p_x","value":"PENDING"}]}]},{"name":"fms_o_ox","params":[{"p":[{"name":"fms_o_o_x","value":"NA"},{"name":"fms_o_o_d","value":""}]}]},{"name":"fms_p2","params":[{"p":[{"name":"fms_p2_d","value":""}]}]},{"name":"fms_o_cx","params":[{"p":[{"name":"fms_o_c_x","value":"NA"},{"name":"fms_o_c_d","value":""}]}]}]}]},{"name":"ph_reg","controlpoints":[{"cp":[{"name":"phap_o","params":[{"p":[{"name":"phap_o","value":"FALSE"}]}]},{"name":"phve_o","params":[{"p":[{"name":"phve_o","value":"FALSE"}]}]}]}]}]}]},{"name":"S2","cultivarCode":"MKN","calculateddata":[{"cd":[{"name":"phytoData","value":"EUA2A2FY"},{"name":"isCultivarB","value":"false"}]}],"controlpointgroups":[{"cpg":[{"name":"cbs","controlpoints":[{"cp":[{"name":"cbs_o_i","params":[{"p":[{"name":"cbs_o_i_x","value":"DUE"},{"name":"cbs_o_i_d","value":""},{"name":"cbs_o_i_r","value":""}]}]},{"name":"cbs_o_e","params":[{"p":[{"name":"cbs_o_e_x","value":"DUE"}]}]},{"name":"cbs_o_l","params":[{"p":[{"name":"cbs_o_l_x","value":"NO LISTING"},{"name":"cbs_o_l_d","value":""}]}]},{"name":"cbs_o_a","params":[{"p":[{"name":"cbs_o_a_x","value":"FALSE"}]}]}]}]},{"name":"eu_reg","controlpoints":[{"cp":[{"name":"euap_o","params":[{"p":[{"name":"euap_o","value":"true"}]}]},{"name":"euve_o","params":[{"p":[{"name":"euve_o","value":"PENDING"}]}]}]}]},{"name":"ir_reg","controlpoints":[{"cp":[{"name":"irap_o","params":[{"p":[{"name":"irap_o","value":"FALSE"}]}]},{"name":"irve_o","params":[{"p":[{"name":"irve_o","value":"FALSE"}]}]}]}]},{"name":"ja_reg","controlpoints":[{"cp":[{"name":"jaap_o","params":[{"p":[{"name":"jaap_o","value":"FALSE"}]}]}]}]},{"name":"us_reg","controlpoints":[{"cp":[{"name":"usap_o","params":[{"p":[{"name":"usap_o","value":"FALSE"}]}]},{"name":"usve_o","params":[{"p":[{"name":"usve_o","value":"PENDING"}]}]}]}]},{"name":"pr_reg","controlpoints":[{"cp":[{"name":"prap_o","params":[{"p":[{"name":"prap_o","value":"TRUE"}]}]},{"name":"prve_o","params":[{"p":[{"name":"prve_o","value":"FALSE"}]}]}]}]},{"name":"sk_reg","controlpoints":[{"cp":[{"name":"skap_o","params":[{"p":[{"name":"skap_o","value":"FALSE"}]}]},{"name":"skve_o","params":[{"p":[{"name":"skve_o","value":"FALSE"}]}]}]}]},{"name":"th_reg","controlpoints":[{"cp":[{"name":"thap_o","params":[{"p":[{"name":"thap_o","value":"FALSE"}]}]},{"name":"thve_o","params":[{"p":[{"name":"thve_o","value":"FALSE"}]}]}]}]},{"name":"bdc","controlpoints":[{"cp":[{"name":"bd_p","params":[{"p":[{"name":"bd_p_x","value":"DUE"},{"name":"bd_p_n","value":""}]}]}]}]},{"name":"fms","controlpoints":[{"cp":[{"name":"fms_o_e","params":[{"p":[{"name":"fms_o_e_x","value":"ALL AVAILABLE"}]}]},{"name":"fms_p1","params":[{"p":[{"name":"fms_p1_d","value":"2019/06/17"}]}]},{"name":"fms_o_p","params":[{"p":[{"name":"fms_o_p_x","value":"800-2"}]}]},{"name":"fms_o_ox","params":[{"p":[{"name":"fms_o_o_x","value":"A2"},{"name":"fms_o_o_d","value":"2019-06-18"}]}]},{"name":"fms_p2","params":[{"p":[{"name":"fms_p2_d","value":""}]}]},{"name":"fms_o_cx","params":[{"p":[{"name":"fms_o_c_x","value":"A2"},{"name":"fms_o_c_d","value":""}]}]}]}]},{"name":"ph_reg","controlpoints":[{"cp":[{"name":"phap_o","params":[{"p":[{"name":"phap_o","value":"FALSE"}]}]},{"name":"phve_o","params":[{"p":[{"name":"phve_o","value":"FALSE"}]}]}]}]}]}]}]}]}

Sample AJAX call (certain browsers will decode gzip response):

<script> 

    $(document).ready(function () { 

        var jwt; 

        var tokenUrl = "https://www.phytclean.co.za/api/oauth2/token"; 

        var dataUrl = "https://www.phytclean.co.za/api/standardphytodata"; 

        var obj = { 

username: 'demoUser', 

              password: '@71dE3OU53r', 

              grant_type: 'password' 

        }; 

        var seasonID = 6; 

        var minutes = 360; 

        $.ajax({ 

            // Get authentication token 

            url: tokenUrl, 

            type: 'POST', 

            dataType: 'json', 

            contentType: 'application/x-www-form-urlencoded; charset=UTF-8', 

            data: obj, 

            success: function (data, textStatus, xhr) { 

                jwt = data.access_token; 

                // Get API Data 

                $.ajax({ 

                    url: dataUrl, 

                    type: 'POST', 

                    dataType: 'text/plain', 

                    contentType: 'application/x-www-form-urlencoded', 

                    data: { 

                        'seasonID': seasonID, 

                        'minutes': minutes, 

                        'outputType': 'json'   COMPULSORY if you want the output in json 

                    }, 

                    headers: { 

                        'Authorization': 'bearer ' + jwt 

                    }, 

                    success: function (data) { 

                        console.log(data); 

                    }, 

                    error: function (xhrXmlHttpRequest, textStatus, errorThrown) { 

                        console.log('Error in Operation'); 

                    } 

                }); 

            }, 

            error: function (xhrXmlHttpRequest, textStatus, errorThrown) { 

                console.log('Error in Operation'); 

            } 

        }); 

    }); 

</script> 

Sample C# code:

HttpClientHandler handler = new HttpClientHandler() 

{ 

AutomaticDecompression = DecompressionMethods.GZip | DecompressionMethods.Deflate 

}; 

 

 using (var client = new HttpClient(handler)) 

 { 

          // your api request code 

 } 

To Test using POSTMAN:
https://www.phytclean.co.za/api/oauth2/token
Authenticate to receive a token using your API username, password and grant_type as shown below.

URL: https://www.phytclean.co.za/api/standardphytodata

Header Tab: Pass Authentication token as shown below.



Body Tab:
Required Parameters:

  • seasonID

Optional Parameters:

  • minutes
  • serverTime
  • controlPointGroupID
  • fboXML
  • outputType

Body Type: form-data

GetCitrusOrchardPhytodata <NEW>  #

Returns the CultivarCode, FboCode, OrchardName, PhytoData and isCultivarB values for each fboCode that is passed for a specific season.

Type of Request: POST
URL: https://www.phytclean.co.za/api/GetCitrusOrchardPhytodata

Required Parameters:

  • Season

An integer representing the seasonID e.g. 11

(Refer to Season’s endpoint: Gets a list of SeasonIDs)

NB: Only pass in a Citrus season for this endpoint

  • fbos

A string array of fboCodes that data needs to be requested for

Request Parameters:

Response Example:

<ArrayOfOrchardDetail xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/PhytCleanWebAPI.Models"> 

    <OrchardDetail> 

        <CultivarCode>AZI</CultivarCode> 

        <FboCode>T54321</FboCode> 

        <OrchardName>32</OrchardName> 

        <PhytoData>EUCCCCNP</PhytoData> 

        <isCultivarB>false</isCultivarB> 

    </OrchardDetail>     

    <OrchardDetail> 

        <CultivarCode>AOM</CultivarCode> 

        <FboCode>T54321</FboCode> 

        <OrchardName>35</OrchardName> 

        <PhytoData>EUB4B4FY</PhytoData> 

        <isCultivarB>true</isCultivarB> 

    </OrchardDetail> 

    <OrchardDetail> 

        <CultivarCode>CKL</CultivarCode> 

        <FboCode>T54321</FboCode> 

        <OrchardName>T1A</OrchardName> 

        <PhytoData>EUCCCCFX</PhytoData> 

        <isCultivarB>false</isCultivarB> 

    </OrchardDetail>     

    <OrchardDetail> 

        <CultivarCode>CKL</CultivarCode> 

        <FboCode>T54321</FboCode> 

        <OrchardName>TEST1B</OrchardName> 

        <PhytoData>EUB2B2FX</PhytoData> 

        <isCultivarB>false</isCultivarB> 

    </OrchardDetail> 

</ArrayOfOrchardDetail> 

GetStoneOrchardPhytodata <NEW>  #

Returns the CultivarCode, FboCode, OrchardName, PhytoData and isCultivarB values for each fboCode that is passed for the current season.

Required Parameters:

  • Season 

An integer representing the seasonID e.g. 12  

(Refer to Season’s endpoint: Gets a list of SeasonIDs)  

NB: Only pass in a Stone season for this endpoint 

A string array of fboCodes that data needs to be requested for

Request Parameters:

Response Parameters:

Response Example:

<ArrayOfOrchardDetail xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/PhytCleanWebAPI.Models"> 

    <OrchardDetail> 

        <CultivarCode>AN1</CultivarCode> 

        <FboCode>T54321</FboCode> 

        <OrchardName>08008</OrchardName> 

        <PhytoData>EUDXFX</PhytoData> 

        <isCultivarB>false</isCultivarB> 

    </OrchardDetail> 

    <OrchardDetail> 

        <CultivarCode></CultivarCode> 

        <FboCode>T54321</FboCode> 

        <OrchardName>10</OrchardName> 

        <PhytoData>EUFYFX</PhytoData> 

        <isCultivarB>false</isCultivarB> 

    </OrchardDetail> 

    <OrchardDetail> 

        <CultivarCode i:nil="true" /> 

        <FboCode>T54321</FboCode> 

        <OrchardName>1000</OrchardName> 

        <PhytoData>EUFYFX</PhytoData> 

        <isCultivarB>false</isCultivarB> 

    </OrchardDetail> 

    <OrchardDetail> 

        <CultivarCode>37Z</CultivarCode> 

        <FboCode>T54321</FboCode> 

        <OrchardName>111</OrchardName> 

        <PhytoData>EUDXFX</PhytoData> 

        <isCultivarB>false</isCultivarB> 

    </OrchardDetail> 

    <OrchardDetail> 

        <CultivarCode>RCU</CultivarCode> 

        <FboCode>T54321</FboCode> 

        <OrchardName>12</OrchardName> 

        <PhytoData>EUFYFX</PhytoData> 

        <isCultivarB>false</isCultivarB> 

    </OrchardDetail> 

    <OrchardDetail> 

        <CultivarCode></CultivarCode> 

        <FboCode>T54321</FboCode> 

        <OrchardName>TEST1</OrchardName> 

        <PhytoData>EUNPDAFF</PhytoData> 

        <isCultivarB>false</isCultivarB> 

    </OrchardDetail> 

</ArrayOfOrchardDetail> 

 

Seasons: Get #

Returns list of Seasons information.

Type of Request: GET
URL: https://www.phytclean.co.za/api/seasons

Glossary: Get #

api/glossary?seasonID: Returns information for ControlpointGroups, Controlpoints and ControlpointAllowedGroups, including definitions of XMLAliasNames abbreviations that are required to understand the StandardPhytoData endpoint.

Type of Request: GET
URL: https://www.phytclean.co.za/api/glossary

Required Parameters:

  • seasonID

An integer representing the seasonID e.g. 11

(Refer Seasons: Get to get the list of SeasonIDs)

Example: https://www.phytclean.co.za/api/glossary?seasonID=6

Pre-Verification2: Get #

api/preverification2?xml: Returns PhytClean Verification Key (and validity time), Original and Current FMS Status of orchards, EU orchard Status, Available shipping Codes, best regime code, flags if FMS status was incorrect, confirmation if selected codes are appropriate, time that API was called, phytoData field, port, determining EU status, regime code that was passed and flags if regime code was correct or not where applicable, pditracker, originalEqualCurrent, cbsAreaCheck.

Please note that no verification Key will be returned if invalid data is passed.

The xml structure that is sent as a parameter is as follows:

<?xml version="1.0"?> 

<Response> 

   <Data> 

 <RegimeCode>...</RegimeCode> 

 <Port>...</Port> 

   </Data> 

   <FboOrchards> 

      <Fbo> 

         <FboCode>...</FboCode> 

      </Fbo> 

      <Orchards> 

         <Orchard> 

            <OrchardName>...</OrchardName> 

     <FMSOrchardStatus>...</FMSOrchardStatus> 

         </Orchard> 

         (...continue with iteration of orchards for that FBO) 

      </Orchards> 

   </FboOrchards> 

   (...add new FBOs) 

</Response> 

Example of Valid data passed to API:

https://www.phytclean.co.za/api/preverification2?xml=<?xml version="1.0"?><Response><Data><RegimeCode>EW001</RegimeCode><Port>ZACPT</Port></Data><FboOrchards><Fbo><FboCode>A0001</FboCode></Fbo><Orchards><Orchard><OrchardName>1</OrchardName><FMSOrchardStatus>CX</FMSOrchardStatus></Orchard><Orchard><OrchardName>2</OrchardName><FMSOrchardStatus>CX</FMSOrchardStatus></Orchard><Orchard><OrchardName>3</OrchardName><FMSOrchardStatus>B2</FMSOrchardStatus></Orchard><Orchard><OrchardName>4</OrchardName><FMSOrchardStatus>B2</FMSOrchardStatus></Orchard><Orchard><OrchardName>5</OrchardName><FMSOrchardStatus>B2</FMSOrchardStatus></Orchard><Orchard><OrchardName>6</OrchardName><FMSOrchardStatus>B2</FMSOrchardStatus></Orchard><Orchard><OrchardName>7</OrchardName><FMSOrchardStatus>B2</FMSOrchardStatus></Orchard><Orchard><OrchardName>8</OrchardName><FMSOrchardStatus>B2</FMSOrchardStatus></Orchard><Orchard><OrchardName>9</OrchardName><FMSOrchardStatus>B2</FMSOrchardStatus></Orchard></Orchards></FboOrchards><FboOrchards><Fbo><FboCode>A0002</FboCode><FMSOrchardStatus>EUCC</FMSOrchardStatus></Fbo><Orchards><Orchard><OrchardName>2</OrchardName><FMSOrchardStatus>CC</FMSOrchardStatus></Orchard><Orchard><OrchardName>3</OrchardName><FMSOrchardStatus>CC</FMSOrchardStatus></Orchard><Orchard><OrchardName>4</OrchardName><FMSOrchardStatus>CC</FMSOrchardStatus></Orchard><Orchard><OrchardName>5</OrchardName><FMSOrchardStatus>CC</FMSOrchardStatus></Orchard><Orchard><OrchardName>6</OrchardName><FMSOrchardStatus>CC</FMSOrchardStatus></Orchard></Orchards></FboOrchards><FboOrchards><Fbo><FboCode>A0007</FboCode></Fbo><Orchards><Orchard><OrchardName>8</OrchardName><FMSOrchardStatus>CC</FMSOrchardStatus></Orchard><Orchard><OrchardName>9</OrchardName><FMSOrchardStatus>CC</FMSOrchardStatus></Orchard><Orchard><OrchardName>10</OrchardName><FMSOrchardStatus>CC</FMSOrchardStatus></Orchard><Orchard><OrchardName>11</OrchardName><FMSOrchardStatus>CC</FMSOrchardStatus></Orchard></Orchards></FboOrchards></Response>

Example of Response:

[ 

    { 

        "puc": "T54321", 

        "orch": "TEST1C", 

        "cultCode": "BSS", 

        "cbs": "TRUE", 

        "applied": "TRUE", 

        "eu": "TRUE", 

        "bd": "NOT REQUIRED", 

        "verified": "APPROVED", 

        "originalfms": "B4", 

        "currentfms": "A1", 

        "pditracker": "PENDING", 

        "fmsStatusPassedCorrect_Original": 1, 

        "fmsStatusPassedCorrect_Current": 0, 

        "determiningFMSStatus_Original": "B4", 

        "determiningFMSStatus_Current": "A1", 

        "availShippingCodes":  

"'EC01','EC0','ECW0','EW01','EC2','EW2','EC1','EW1','EC3','ECW01'", 

        "bestRegimeCode": "EC3", 

        "reportTime": "2019-04-03T10:37:43.44", 

        "dataExpirationTime": "2019-04-05T14:37:43.44", 

        "verificationKey": "694840AB", 

        "userName": "phytcleanwebapiuser", 

        "phytoData": "EUB4A1FY", 

        "port": "ZADUR", 

        "determiningEUStatus": "true", 

        "regimeCode": "EC0", 

        "regimeCodePassedCorrect": 1, 

        "originalEqualCurrent": 0, 

        "cbsAreaCheck": "CBS FREE ONLY" 

    } 

] 

Pre-Verification2: Post #

api/preverification2: This is exactly like Get Pre-Verification2 but instead of using the GET method, the POST method is used which allows for larger a dataset to be passed.

Refer to Pre-Verification2: Get for example and structure of data.
              

Regime Codes: Get #

api/regimecode: Returns list of Regime Codes

Type of Request: GET
URL: https://www.phytclean.co.za/api/regimecode

C:\Users\Kez\AppData\Local\Microsoft\Windows\INetCache\Content.Word\regimecode-thn.png

FMS Orchard Status Code: Get #

api/fmsorchardstatuscode: Returns list of orchard status codes

Type of Request: GET
URL: https://www.phytclean.co.za/api/fmsorchardstatuscode

C:\Users\Kez\AppData\Local\Microsoft\Windows\INetCache\Content.Word\fmsorchardstatuscode-thn.png

Regime Codes per Port for each FMS Orchard Status Code: Get #

api/regimecodeperportperstatus: Returns list of regime codes per port for each orchard status code.

Type of Request: GET
URL: https://www.phytclean.co.za/api/regimecodeperportperstatus