### Example REST API URL with Specific Version Source: https://docs.aiaplatform.com.au/index This example shows how to specify a particular version (e.g., 3.0.0) when accessing an emissions calculator via the REST API. This ensures consistent results and stability. ```plaintext https://emissionscalculator-mtls.production.aiaapi.com/calculator/calculator/3.0.0/sheepbeef ``` -------------------------------- ### Example REST API URL for Beef Calculator Source: https://docs.aiaplatform.com.au/index This is an example URL for accessing the beef emissions calculator via the REST API. Replace 'latest' with a specific version number and 'beef' with the desired calculator name. ```plaintext https://emissionscalculator-mtls.production.aiaapi.com/calculator/calculator/latest/beef ``` -------------------------------- ### Making API Requests Source: https://docs.aiaplatform.com.au/api/3.0.0/authentication This section provides an example of how to make a POST request to the Emissions Calculators API using cURL, demonstrating the inclusion of the private key and certificate for authentication. It also covers response validation. ```APIDOC ## Making Requests Once you have your private key and certificate, you can make requests to the API. ### Example cURL Request This example demonstrates a POST request to the sheep/beef calculator endpoint. ```bash curl --request POST \ --key carbon-calculator-integration.key \ --cert carbon-calculator-integration.pem \ -v \ --url https://emissionscalculator-mtls.production.aiaapi.com/calculator/calculator/3.0.0/sheepbeef \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data '{}' ``` ### Validating Responses Responses from the API are signed with the server's certificate. You should validate the response by checking: * The certificate has not expired. * The certificate is trusted by your operating system's trust store. * The certificate's common name is `*.aiaapi.com`. **Note:** For web-based applications, it is recommended to use the NPM package directly to avoid mTLS issues in the browser. ``` -------------------------------- ### Perform Aquaculture Calculation (Shell Curl) Source: https://docs.aiaplatform.com.au/api/3.0.0/api-reference This example demonstrates how to perform an aquaculture calculation using a cURL command. It sends a POST request to the specified API endpoint with a JSON payload containing detailed enterprise information. The request includes data on production, refrigerants, bait, freight, energy consumption, waste management, and carbon offsets. ```shell curl https://emissionscalculator-mtls.production.aiaapi.com/calculator/3.0.0/aquaculture \ --request POST \ --header 'Content-Type: application/json' \ --data '{ "enterprises": [ { "id": "", "state": "nsw", "productionSystem": "Abalone Farming", "totalHarvestKg": 0, "refrigerants": [ { "refrigerant": "HFC-23", "chargeSize": 0 } ], "bait": [ { "type": "Whole Sardines", "purchasedTonnes": 0, "additionalIngredients": 0, "emissionsIntensity": 0 } ], "customBait": [ { "purchasedTonnes": 0, "emissionsIntensity": 0 } ], "inboundFreight": [ { "type": "Truck", "totalKmTonnes": 0 } ], "outboundFreight": [ { "type": "Truck", "totalKmTonnes": 0 } ], "totalCommercialFlightsKm": 0, "electricityRenewable": 0, "electricityUse": 0, "electricitySource": "State Grid", "fuel": { "transportFuel": [ { "type": "petrol", "amountLitres": 0 } ], "stationaryFuel": [ { "type": "petrol", "amountLitres": 0 } ], "naturalGas": 0 }, "fluidWaste": [ { "fluidWasteKl": 0, "fluidWasteTreatmentType": "Managed Aerobic", "averageInletCOD": 0, "averageOutletCOD": 0, "flaredCombustedFraction": 0 } ], "solidWaste": { "sentOffsiteTonnes": 1, "onsiteCompostingTonnes": 1 }, "carbonOffsets": 0 } ] }' ``` -------------------------------- ### AIA Emissions Calculator API Request (Curl) Source: https://docs.aiaplatform.com.au/api/3.0.0/api-reference Example cURL command to send a POST request to the AIA emissions calculator API for version 3.0.0. This demonstrates how to make an API call to the specified endpoint, including setting necessary headers like 'Content-Type'. ```bash curl -X POST https://emissionscalculator-mtls.production.aiaapi.com/calculator/3.0.0/aquaculture \ -H "Content-Type: application/json" \ -d '{...}' ``` -------------------------------- ### cURL Request to Sheepbeef Calculator Source: https://docs.aiaplatform.com.au/index This is an example cURL command for making a POST request to the sheepbeef emissions calculator. It includes essential headers, the URL with versioning, and a placeholder for the request payload. Mutual TLS authentication with valid client certificates is required. ```bash curl --request POST \ --key /path/to/your/client-request.key \ --cert /path/to/your/client-request.pem \ --url https://emissionscalculator-mtls.production.aiaapi.com/calculator/2.0.0/sheepbeef \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'User-Agent: my-organisation-name-integration' \ --data '{'{ ... valid request payload ... }'}' ``` -------------------------------- ### Install AIA Emissions Calculators NPM Package Source: https://docs.aiaplatform.com.au/api/3.0.0/package This command installs the AIA Emissions Calculators package from NPM. This package provides various calculators for environmental emissions. ```bash npm install @aginnovationaustralia/emissions-calculators ``` -------------------------------- ### Example: Calculate Grains Emissions using NPM Package Source: https://docs.aiaplatform.com.au/api/3.0.0/package Demonstrates how to use the AIA Emissions Calculators NPM package to calculate emissions for grains. It includes steps for creating an input object, validating it, and performing the calculation. ```typescript import { Calculators, Types } from '@aginnovationaustralia/emissions-calculators'; const { calculateGrains, validateCalculatorInput } = Calculators; // Populate an input object with the data for the calculator const grainsInput: Types.GrainsInput = { state: 'nsw' as const, crops: [ { areaSown: 5, averageGrainYield: 10, productionSystem: 'Irrigated crop', type: 'Oats', state: 'nsw', nonUreaNitrogen: 2, ureaApplication: 3, ureaAmmoniumNitrate: 4, phosphorusApplication: 1, potassiumApplication: 1, sulfurApplication: 1, rainfallAbove600: true, fractionOfAnnualCropBurnt: 0, herbicideUse: 5, glyphosateOtherHerbicideUse: 2, electricityAllocation: 0.5, limestone: 1, limestoneFraction: 0.5, dieselUse: 1000, petrolUse: 10, lpg: 2000, }, ], electricityRenewable: 0, electricityUse: 2500, vegetation: [], }; // Validate the input and perform the calculation export const calculateGrains300 = () => { try { // Check that every input key has a valid value const input = validateCalculatorInput(Types.GrainsInputSchema, grainsInput); const result = calculateGrains(input); return result; } catch (error) { console.error('Error calculating grains:', error); return null; } }; ``` -------------------------------- ### AIA Emissions Calculators API Endpoints Source: https://docs.aiaplatform.com.au/api/3.0.0/welcome This section outlines the general structure and usage of the AIA Emissions Calculators REST API, including versioning and example requests for specific calculators. ```APIDOC ## GET /calculator/{version}/{calculator_name} ### Description This endpoint allows you to retrieve emission calculation results for a specific agricultural activity. ### Method GET ### Endpoint `/calculator/{version}/{calculator_name}` ### Parameters #### Path Parameters - **version** (string) - Required - The version of the calculator API to use (e.g., `latest`, `3.0.0`). - **calculator_name** (string) - Required - The name of the specific calculator (e.g., `beef`, `grains`, `sheep`). ### Request Example ```bash curl --request GET \ --key /path/to/your/client-request.key \ --cert /path/to/your/client-request.pem \ --url https://emissionscalculator-mtls.production.aiaapi.com/calculator/latest/beef \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' ``` ### Response #### Success Response (200) - **result** (object) - Contains the emission calculation results. #### Response Example ```json { "calculation_details": { ... } } ``` --- ## POST /calculator/{version}/{calculator_name} ### Description This endpoint allows you to submit data to perform an emission calculation for a specific agricultural activity. ### Method POST ### Endpoint `/calculator/{version}/{calculator_name}` ### Parameters #### Path Parameters - **version** (string) - Required - The version of the calculator API to use (e.g., `latest`, `3.0.0`). - **calculator_name** (string) - Required - The name of the specific calculator (e.g., `beef`, `grains`, `sheep`). #### Request Body - **request_payload** (object) - Required - The payload containing the data for the emission calculation. The structure of this payload varies depending on the `calculator_name`. ### Request Example ```bash curl --request POST \ --key /path/to/your/client-request.key \ --cert /path/to/your/client-request.pem \ --url https://emissionscalculator-mtls.production.aiaapi.com/calculator/2.0.0/sheepbeef \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'User-Agent: my-organisation-name-integration' \ --data '{... valid request payload ...}' ``` ### Response #### Success Response (200) - **calculation_results** (object) - Contains the results of the emission calculation. #### Response Example ```json { "emissions": { ... }, "metadata": { ... } } ``` --- **Available Calculators:** - `/aquaculture` - `/beef` - `/buffalo` - `/cotton` - `/dairy` - `/deer` - `/feedlot` - `/goat` - `/grains` - `/horticulture` - `/pork` - `/poultry` - `/processing` - `/rice` - `/sheep` - `/sheepbeef` - `/sugar` - `/vineyard` - `/wildcatchfishery` - `/wildseafisheries **Versioning:** The API uses Semantic Versioning. Versions can be specified in the URL (e.g., `3.0.0`) or using the alias `latest`. ``` -------------------------------- ### POST /calculator/3.0.0/aquaculture Source: https://docs.aiaplatform.com.au/api/3.0.0/api-reference Executes an aquaculture emissions calculation based on the provided enterprise details. ```APIDOC ## POST /calculator/3.0.0/aquaculture ### Description Performs an aquaculture emissions calculation. This endpoint takes detailed information about aquaculture enterprises, including their state, production system, harvest data, inputs like bait and feed, energy sources, freight information, waste management practices, and carbon offset data, to compute the overall carbon footprint. ### Method POST ### Endpoint `https://emissionscalculator-mtls.production.aiaapi.com/calculator/3.0.0/aquaculture` ### Parameters #### Request Body - **enterprises** (array) - Required - An array of enterprise objects, each containing detailed information for calculation. - **id** (string) - Optional - Unique identifier for the enterprise. - **state** (string) - Required - The state in which the aquaculture operation is located (e.g., 'nsw'). - **productionSystem** (string) - Required - The type of aquaculture production system (e.g., 'Abalone Farming'). - **totalHarvestKg** (number) - Required - Total harvest in kilograms. - **refrigerants** (array) - Optional - List of refrigerants used. - **refrigerant** (string) - Required - Type of refrigerant. - **chargeSize** (number) - Required - Charge size of the refrigerant. - **bait** (array) - Optional - Details of bait used. - **type** (string) - Required - Type of bait. - **purchasedTonnes** (number) - Required - Amount of bait purchased in tonnes. - **additionalIngredients** (number) - Required - Amount of additional ingredients. - **emissionsIntensity** (number) - Required - Emissions intensity factor for the bait. - **customBait** (array) - Optional - Details of custom bait used. - **purchasedTonnes** (number) - Required - Amount of custom bait purchased in tonnes. - **emissionsIntensity** (number) - Required - Emissions intensity factor for the custom bait. - **inboundFreight** (array) - Optional - Details of inbound freight. - **type** (string) - Required - Type of freight transport. - **totalKmTonnes** (number) - Required - Total kilometers and tonnes transported. - **outboundFreight** (array) - Optional - Details of outbound freight. - **type** (string) - Required - Type of freight transport. - **totalKmTonnes** (number) - Required - Total kilometers and tonnes transported. - **totalCommercialFlightsKm** (number) - Optional - Total kilometers traveled by commercial flights. - **electricityRenewable** (number) - Optional - Amount of renewable electricity used. - **electricityUse** (number) - Optional - Total electricity used. - **electricitySource** (string) - Optional - Source of electricity (e.g., 'State Grid'). - **fuel** (object) - Optional - Fuel consumption details. - **transportFuel** (array) - Optional - Transport fuel used. - **type** (string) - Required - Type of transport fuel. - **amountLitres** (number) - Required - Amount of fuel in litres. - **stationaryFuel** (array) - Optional - Stationary fuel used. - **type** (string) - Required - Type of stationary fuel. - **amountLitres** (number) - Required - Amount of fuel in litres. - **naturalGas** (number) - Optional - Amount of natural gas used. - **fluidWaste** (array) - Optional - Details of fluid waste management. - **fluidWasteKl** (number) - Required - Volume of fluid waste in kilolitres. - **fluidWasteTreatmentType** (string) - Required - Type of fluid waste treatment. - **averageInletCOD** (number) - Optional - Average Chemical Oxygen Demand at inlet. - **averageOutletCOD** (number) - Optional - Average Chemical Oxygen Demand at outlet. - **flaredCombustedFraction** (number) - Optional - Fraction of waste flared or combusted. - **solidWaste** (object) - Optional - Details of solid waste management. - **sentOffsiteTonnes** (number) - Optional - Amount of solid waste sent offsite in tonnes. - **onsiteCompostingTonnes** (number) - Optional - Amount of solid waste composted onsite in tonnes. - **carbonOffsets** (number) - Optional - Amount of carbon offsets applied. ### Request Example ```json { "enterprises": [ { "id": "", "state": "nsw", "productionSystem": "Abalone Farming", "totalHarvestKg": 0, "refrigerants": [ { "refrigerant": "HFC-23", "chargeSize": 0 } ], "bait": [ { "type": "Whole Sardines", "purchasedTonnes": 0, "additionalIngredients": 0, "emissionsIntensity": 0 } ], "customBait": [ { "purchasedTonnes": 0, "emissionsIntensity": 0 } ], "inboundFreight": [ { "type": "Truck", "totalKmTonnes": 0 } ], "outboundFreight": [ { "type": "Truck", "totalKmTonnes": 0 } ], "totalCommercialFlightsKm": 0, "electricityRenewable": 0, "electricityUse": 0, "electricitySource": "State Grid", "fuel": { "transportFuel": [ { "type": "petrol", "amountLitres": 0 } ], "stationaryFuel": [ { "type": "petrol", "amountLitres": 0 } ], "naturalGas": 0 }, "fluidWaste": [ { "fluidWasteKl": 0, "fluidWasteTreatmentType": "Managed Aerobic", "averageInletCOD": 0, "averageOutletCOD": 0, "flaredCombustedFraction": 0 } ], "solidWaste": { "sentOffsiteTonnes": 1, "onsiteCompostingTonnes": 1 }, "carbonOffsets": 0 } ] } ``` ### Response #### Success Response (200) - **totalCO2** (number) - Total Carbon Dioxide emissions. - **totalCH4** (number) - Total Methane emissions. - **totalN2O** (number) - Total Nitrous Oxide emissions. - **total** (number) - Total combined emissions. - **scope1** (object) - Scope 1 emissions breakdown. - **fuelCO2**, **fuelCH4**, **fuelN2O** (number) - Fuel-related emissions. - **ureaCO2**, **limeCO2**, **fertiliserN2O** (number) - Emissions from urea, lime, and fertiliser. - **entericCH4**, **manureManagementCH4** (number) - Methane from enteric fermentation and manure management. - **urineAndDungN2O**, **atmosphericDepositionN2O**, **leachingAndRunoffN2O** (number) - Nitrous Oxide from various sources. - **savannahBurningN2O**, **savannahBurningCH4** (number) - Emissions from savannah burning. - **totalCO2**, **totalCH4**, **totalN2O**, **total** (number) - Subtotals for Scope 1. - **scope2** (object) - Scope 2 emissions breakdown. - **electricity** (number) - Emissions from electricity consumption. - **total** (number) - Total Scope 2 emissions. - **scope3** (object) - Scope 3 emissions breakdown. - **fertiliser**, **purchasedMineralSupplementation**, **purchasedFeed**, **herbicide**, **electricity**, **fuel**, **lime**, **purchasedLivestock** (number) - Various Scope 3 emission sources. - **total** (number) - Total Scope 3 emissions. - **carbonSequestration** (object) - Carbon sequestration details. - **total** (number) - Total carbon sequestration. - **intermediate** (array) - Intermediate calculation results for each enterprise. - Contains detailed breakdowns similar to the main response for each enterprise. - **net** (object) - Net emissions after accounting for sequestration. - **total**, **beef** (number) - Net total emissions. - **intensities** (object) - Emission intensity metrics. - **liveweightBeefProducedKg**, **beefExcludingSequestration**, **beefIncludingSequestration** (number) - Intensity values per kilogram of beef produced. ``` -------------------------------- ### Cows Calving and Burning Parameters Data Structure Source: https://docs.aiaplatform.com.au/api/3.0.0/api-reference This snippet details calving data by season and parameters related to savannah burning. It includes seasonal head counts for calving cows and specific attributes for burning, such as fuel type, season, patchiness, rainfall zone, years since last fire, fire scar area, and vegetation type, along with allocation to beef. ```json "cowsCalving": { "spring": 0, "summer": 0, "autumn": 0, "winter": 0 } "burning": [ { "burning": { "fuel": "coarse", "season": "early dry season", "patchiness": "high", "rainfallZone": "low", "yearsSinceLastFire": 0, "fireScarArea": 0, "vegetation": "Melaleuca woodland" }, "allocationToBeef": [ 0 ] } ] ``` -------------------------------- ### Energy and Miscellaneous Inputs Data Structure Source: https://docs.aiaplatform.com.au/api/3.0.0/api-reference This snippet outlines the structure for energy sources and other miscellaneous inputs. It includes fuel types (diesel, petrol, LPG), electricity source and usage (renewable and total), and herbicide types. ```json "diesel": 0, "petrol": 0, "lpg": 0, "electricitySource": "State Grid", "electricityRenewable": 0, "electricityUse": 0, "herbicide": 0, "herbicideOther": 0 ``` -------------------------------- ### Perform Beef Calculation using cURL Source: https://docs.aiaplatform.com.au/api/3.0.0/api-reference This snippet demonstrates how to perform a beef calculation using a cURL command. It sends a POST request to the API endpoint with a JSON payload containing the necessary input data for the beef enterprise. ```shell curl https://emissionscalculator-mtls.production.aiaapi.com/calculator/3.0.0/beef \ --request POST \ --header 'Content-Type: application/json' \ --data '{ "state": "nsw", "northOfTropicOfCapricorn": true, "rainfallAbove600": true, "beef": [ { "id": "", "classes": { "bullsGt1": { "autumn": { "head": 0, "liveweight": 0, "liveweightGain": 1, "crudeProtein": 0, "dryMatterDigestibility": 0 }, "winter": { "head": 0, "liveweight": 0, "liveweightGain": 1, "crudeProtein": 0, "dryMatterDigestibility": 0 }, "spring": { "head": 0, "liveweight": 0, "liveweightGain": 1, "crudeProtein": 0, "dryMatterDigestibility": 0 }, "summer": { "head": 0, "liveweight": 0, "liveweightGain": 1, "crudeProtein": 0, "dryMatterDigestibility": 0 }, "headSold": 0, "saleWeight": 0, "purchases": [ { "head": 0, "purchaseWeight": 0, "purchaseSource": "Dairy origin" } ] }, "bullsGt1Traded": { "autumn": { "head": 0, "liveweight": 0, "liveweightGain": 1, "crudeProtein": 0, "dryMatterDigestibility": 0 }, "winter": { "head": 0, "liveweight": 0, "liveweightGain": 1, "crudeProtein": 0, "dryMatterDigestibility": 0 }, "spring": { "head": 0, "liveweight": 0, "liveweightGain": 1, "crudeProtein": 0, "dryMatterDigestibility": 0 }, "summer": { "head": 0, "liveweight": 0, "liveweightGain": 1, "crudeProtein": 0, "dryMatterDigestibility": 0 }, "headSold": 0, "saleWeight": 0, "purchases": [ { "head": 0, "purchaseWeight": 0, "purchaseSource": "Dairy origin" } ] }, "steersLt1": { "autumn": { "head": 0, "liveweight": 0, "liveweightGain": 1, "crudeProtein": 0, "dryMatterDigestibility": 0 }, "winter": { "head": 0, "liveweight": 0, "liveweightGain": 1, "crudeProtein": 0, "dryMatterDigestibility": 0 }, "spring": { "head": 0, "liveweight": 0, "liveweightGain": 1, "crudeProtein": 0, "dryMatterDigestibility": 0 }, "summer": { "head": 0, "liveweight": 0, "liveweightGain": 1, "crudeProtein": 0, "dryMatterDigestibility": 0 }, "headSold": 0, "saleWeight": 0, "purchases": [ { "head": 0, "purchaseWeight": 0, "purchaseSource": "Dairy origin" } ] }, "steersLt1Traded": { "autumn": { "head": 0, "liveweight": 0, "liveweightGain": 1, "crudeProtein": 0, "dryMatterDigestibility": 0 }, "winter": { "head": 0, "liveweight": 0, "liveweightGain": 1, "crudeProtein": 0, "dryMatterDigestibility": 0 }, "spring": { "head": 0, "liveweight": 0, "liveweightGain": 1, "crudeProtein": 0, "dryMatterDigestibility": 0 }, "summer": { "head": 0, "liveweight": 0, "liveweightGain": 1, "crudeProtein": 0, "dryMatterDigestibility": 0 }, "headSold": 0, "saleWeight": 0, "purchases": [ { "head": 0, "purchaseWeight": 0, "purchaseSource": "Dairy origin" } ] } } } ] }' ``` -------------------------------- ### mTLS Authentication and Certificate Generation Source: https://docs.aiaplatform.com.au/api/3.0.0/authentication This section details the process of setting up mutual TLS (mTLS) for secure API authentication. It includes instructions on generating a private key and a Certificate Signing Request (CSR), and explains how to submit the CSR to obtain an API certificate. ```APIDOC ## mTLS Authentication To securely authenticate with the Emissions Calculators API, mutual TLS (mTLS) is used. This ensures both the client and server verify each other's identity. You will need a certificate and private key to make authenticated requests. ### Getting a Certificate 1. **Generate a Private Key:** ```bash openssl genrsa -out carbon-calculator-integration.key 4096 ``` 2. **Create a Certificate Signing Request (CSR):** Replace `[REPLACE ORG NAME HERE]` with your organization's name. ```bash openssl req -new -key carbon-calculator-integration.key -subj "/C=AU/ST=New South Wales/L=Sydney/O=[REPLACE ORG NAME HERE]" -out certificate-request.csr ``` 3. **Submit CSR:** Submit the generated `certificate-request.csr` file via the API Integrator Application form. **Security Note:** Keep your private key secure and never share it. To revoke a certificate, contact contact@aginnovationaustralia.com.au. ### User Agent Header A `User-Agent` header is required for requests. Set it to your organization's name (e.g., `User-Agent: my-organisation-name-integration`). Failure to do so may result in a `403 Forbidden` response. ``` -------------------------------- ### Fertiliser and Mineral Supplementation Data Structure Source: https://docs.aiaplatform.com.au/api/3.0.0/api-reference This snippet defines the structure for recording fertiliser and mineral supplementation. It includes types of fertilisers like single superphosphate and others, with separate values for dryland and irrigated areas. Mineral supplementation options include various blocks and dry season mixes, some with urea. ```json "limestone": 0, "limestoneFraction": 0, "fertiliser": { "singleSuperphosphate": 0, "pastureDryland": 0, "pastureIrrigated": 0, "cropsDryland": 0, "cropsIrrigated": 0, "otherFertilisers": [ { "otherType": "Monoammonium phosphate (MAP)", "otherDryland": 0, "otherIrrigated": 0 } ] }, "mineralSupplementation": { "mineralBlock": 0, "mineralBlockUrea": 0, "weanerBlock": 0, "weanerBlockUrea": 0, "drySeasonMix": 0, "drySeasonMixUrea": 0 } ``` -------------------------------- ### Beef Livestock and Feed Data Structure Source: https://docs.aiaplatform.com.au/api/3.0.0/api-reference This snippet details the structure for tracking livestock and feed. It includes seasonal data for different age groups of heifers (1-2 years and >2 years), their liveweight, gain, protein, and digestibility. It also tracks sales, purchases, and specific feed types like grain, hay, and cottonseed. ```json { "heifers1To2Traded": { "autumn": { "head": 0, "liveweight": 0, "liveweightGain": 1, "crudeProtein": 0, "dryMatterDigestibility": 0 }, "winter": { "head": 0, "liveweight": 0, "liveweightGain": 1, "crudeProtein": 0, "dryMatterDigestibility": 0 }, "spring": { "head": 0, "liveweight": 0, "liveweightGain": 1, "crudeProtein": 0, "dryMatterDigestibility": 0 }, "summer": { "head": 0, "liveweight": 0, "liveweightGain": 1, "crudeProtein": 0, "dryMatterDigestibility": 0 }, "headSold": 0, "saleWeight": 0, "purchases": [ { "head": 0, "purchaseWeight": 0, "purchaseSource": "Dairy origin" } ] }, "heifersGt2": { "autumn": { "head": 0, "liveweight": 0, "liveweightGain": 1, "crudeProtein": 0, "dryMatterDigestibility": 0 }, "winter": { "head": 0, "liveweight": 0, "liveweightGain": 1, "crudeProtein": 0, "dryMatterDigestibility": 0 }, "spring": { "head": 0, "liveweight": 0, "liveweightGain": 1, "crudeProtein": 0, "dryMatterDigestibility": 0 }, "summer": { "head": 0, "liveweight": 0, "liveweightGain": 1, "crudeProtein": 0, "dryMatterDigestibility": 0 }, "headSold": 0, "saleWeight": 0, "purchases": [ { "head": 0, "purchaseWeight": 0, "purchaseSource": "Dairy origin" } ] }, "heifersGt2Traded": { "autumn": { "head": 0, "liveweight": 0, "liveweightGain": 1, "crudeProtein": 0, "dryMatterDigestibility": 0 }, "winter": { "head": 0, "liveweight": 0, "liveweightGain": 1, "crudeProtein": 0, "dryMatterDigestibility": 0 }, "spring": { "head": 0, "liveweight": 0, "liveweightGain": 1, "crudeProtein": 0, "dryMatterDigestibility": 0 }, "summer": { "head": 0, "liveweight": 0, "liveweightGain": 1, "crudeProtein": 0, "dryMatterDigestibility": 0 }, "headSold": 0, "saleWeight": 0, "purchases": [ { "head": 0, "purchaseWeight": 0, "purchaseSource": "Dairy origin" } ] } }, "grainFeed": 0, "hayFeed": 0, "cottonseedFeed": 0 ``` -------------------------------- ### Available Calculators Source: https://docs.aiaplatform.com.au/index List of available calculator endpoints for various agricultural activities. ```APIDOC ## Available Calculators ### Description The following calculators are available via the REST API: - `/aquaculture` - `/beef` - `/buffalo` - `/cotton` - `/dairy` - `/deer` - `/feedlot` - `/goat` - `/grains` - `/horticulture` - `/pork` - `/poultry` - `/processing` - `/rice` - `/sheep` - `/sheepbeef` - `/sugar` - `/vineyard` - `/wildcatchfishery` - `/wildseafisheries` ### Example Endpoint Structure `https://emissionscalculator-mtls.production.aiaapi.com/calculator/calculator/{version}/{calculator_name}` *Replace `{version}` with a specific version number (e.g., `3.0.0`) or `latest`.* *Replace `{calculator_name}` with one of the calculators listed above.* ``` -------------------------------- ### Make Authenticated API Request using cURL Source: https://docs.aiaplatform.com.au/api/3.0.0/authentication Demonstrates how to make a POST request to the Emissions Calculators API using cURL with mTLS authentication. It requires the private key (`--key`) and certificate (`--cert`) files, along with `Accept` and `Content-Type` headers. ```bash curl --request POST \ --key carbon-calculator-integration.key \ --cert carbon-calculator-integration.pem \ -v \ --url https://emissionscalculator-mtls.production.aiaapi.com/calculator/calculator/3.0.0/sheepbeef \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data '{}' ``` -------------------------------- ### Create Certificate Signing Request (CSR) using OpenSSL Source: https://docs.aiaplatform.com.au/api/3.0.0/authentication Creates a Certificate Signing Request (CSR) from a private key. This CSR will be submitted to obtain an API certificate. Remember to replace '[REPLACE ORG NAME HERE]' with your organization's name. ```bash openssl req -new -key carbon-calculator-integration.key -subj "/C=AU/ST=New South Wales/L=Sydney/O=[REPLACE ORG NAME HERE]" -out certificate-request.csr ```