Chemical Products - Create Or Update
Creates or updates a chemicalProduct resource.
PATCH {endpoint}/chemical-products/{chemicalProductId}?api-version=2023-11-01-preview
URI Parameters
Name | In | Required | Type | Description |
---|---|---|---|---|
chemical
|
path | True |
string |
Id of the chemicalProduct resource. |
endpoint
|
path | True |
string (uri) |
The host name of the namespace, e.g. admaInstanceName.farmbeats.azure.net |
api-version
|
query | True |
string |
The requested API version |
Request Header
Media Types: "application/merge-patch+json"
Name | Required | Type | Description |
---|---|---|---|
Authorization | True |
string |
Please provide a valid bearer token for authorized API calls. Note that you might need to clear your browser cache if you tried un-authenticated calls before. |
Request Body
Media Types: "application/merge-patch+json"
Name | Type | Description |
---|---|---|
activeIngredients |
string[] |
Active chemicals in the formulation. |
brand |
string |
Commercial brand of the chemical product. |
company |
Company/Manufacturer's details. |
|
cropIds |
string[] |
The Ids of the crops associated with the Chemical product. Note: A maximum of 25 crops can be associated with a cropProduct. |
description |
string minLength: 0maxLength: 500 |
Textual description of the resource. |
formulation |
string |
Formulation description. Percentage or other unit of N, P, K, CA, MG, S, FE, MN, ZN, CU, B, MO, CL (based on the source, the available chemical elements can vary, but this is a typical list). |
location |
string |
Area where the chemical is used. This is important from a compliance perspective. |
name |
string minLength: 0maxLength: 100 |
Name to identify resource. |
product |
string |
Commercial product name of the chemical product. |
properties |
|
A collection of key value pairs that belongs to the resource. Each pair must not have a key greater than 50 characters and must not have a value greater than 150 characters. Note: A maximum of 25 key value pairs can be provided for a resource and only string, numeral and datetime (yyyy-MM-ddTHH:mm:ssZ) values are supported. |
reEntryInterval |
integer (int32) |
The number of days after which a person can visit the field after the chemical product is applied. |
reference |
Reference to a dataset record. |
|
registrationNumber |
string |
Registration number of the chemical. This could vary by geography. |
source |
string minLength: 2maxLength: 100 |
Source of the resource. |
specificGravity |
string |
Specific gravity details. |
state |
string |
Liquid/non Liquid. |
status |
string minLength: 0maxLength: 100 |
Status of the resource. |
type |
string |
Herbicide, Additive, Insecticides, Fertilizers. |
Responses
Name | Type | Description |
---|---|---|
200 OK |
Success |
|
201 Created |
Created |
|
Other Status Codes |
Error Headers x-ms-error-code: string |
Security
Authorization
Please provide a valid bearer token for authorized API calls. Note that you might need to clear your browser cache if you tried un-authenticated calls before.
Type:
apiKey
In:
header
Examples
ChemicalProducts_CreateOrUpdate
Sample request
PATCH {endpoint}/chemical-products/Chemical123?api-version=2023-11-01-preview
{
"cropIds": [
"CropId"
],
"reference": {
"datasetId": "datasetId",
"recordId": "recordId"
},
"brand": "Brand",
"product": "AGTECH",
"type": "Herbicide",
"state": "Liquid",
"activeIngredients": [
"NO2"
],
"specificGravity": "string",
"formulation": "N, P, K",
"company": {
"name": "CompanyName",
"description": "Agriculture Manufacturer",
"registrationNumber": "1234"
},
"location": "US",
"registrationNumber": "1234",
"reEntryInterval": 5,
"status": "Active",
"source": "Manufacturer",
"name": "Fertilizer1",
"description": "string",
"properties": {
"key1": "value1",
"key2": 123.45
}
}
Sample response
{
"id": "Chemical123",
"cropIds": [
"CropId"
],
"reference": {
"datasetId": "datasetId",
"recordId": "recordId"
},
"brand": "Brand",
"product": "AGTECH",
"type": "Herbicide",
"state": "Liquid",
"activeIngredients": [
"NO2"
],
"specificGravity": "string",
"formulation": "N, P, K",
"company": {
"name": "CompanyName",
"description": "Agriculture Manufacturer",
"registrationNumber": "1234"
},
"location": "US",
"registrationNumber": "1234",
"reEntryInterval": 5,
"status": "Active",
"source": "Manufacturer",
"name": "Fertilizer1",
"description": "string",
"properties": {
"key1": "value1",
"key2": 123.45
},
"createdDateTime": "2021-04-21T06:49:30Z",
"modifiedDateTime": "2021-04-21T06:49:30Z",
"createdBy": "00000000-0000-0000-0000-000000000000",
"modifiedBy": "00000000-0000-0000-0000-000000000000",
"eTag": "0f8fad5b-d9cb-469f-a165-70867728950e"
}
{
"id": "Chemical123",
"cropIds": [
"CropId"
],
"reference": {
"datasetId": "datasetId",
"recordId": "recordId"
},
"brand": "Brand",
"product": "AGTECH",
"type": "Herbicide",
"state": "Liquid",
"activeIngredients": [
"NO2"
],
"specificGravity": "string",
"formulation": "N, P, K",
"company": {
"name": "CompanyName",
"description": "Agriculture Manufacturer",
"registrationNumber": "1234"
},
"location": "US",
"registrationNumber": "1234",
"reEntryInterval": 5,
"status": "Active",
"source": "Manufacturer",
"name": "Fertilizer1",
"description": "string",
"properties": {
"key1": "value1",
"key2": 123.45
},
"createdDateTime": "2021-04-21T06:49:30Z",
"modifiedDateTime": "2021-04-21T06:49:30Z",
"createdBy": "00000000-0000-0000-0000-000000000000",
"modifiedBy": "00000000-0000-0000-0000-000000000000",
"eTag": "0f8fad5b-d9cb-469f-a165-70867728950e"
}
Definitions
Name | Description |
---|---|
Chemical |
Schema of ChemicalProduct resource. |
Company |
Company/Manufacturer's details. |
Error |
An error from the Azure AgPlatform service. |
Error |
An error response from the Azure AgPlatform service. See https://github.com/Microsoft/api-guidelines/blob/vNext/Guidelines.md#7102-error-condition-responses for ErrorResponse reference document. |
Inner |
Inner error containing list of errors.See https://github.com/Microsoft/api-guidelines/blob/vNext/Guidelines.md#innererror--object for InnerError reference document. |
Reference |
Reference to a dataset record. |
ChemicalProduct
Schema of ChemicalProduct resource.
Name | Type | Description |
---|---|---|
activeIngredients |
string[] |
Active chemicals in the formulation. |
brand |
string |
Commercial brand of the chemical product. |
company |
Company/Manufacturer's details. |
|
createdBy |
string |
Created by user/tenant id. |
createdDateTime |
string (date-time) |
Date-time when resource was created, sample format: yyyy-MM-ddTHH:mm:ssZ. |
cropIds |
string[] |
The Ids of the crops associated with the Chemical product. Note: A maximum of 25 crops can be associated with a cropProduct. |
description |
string minLength: 0maxLength: 500 |
Textual description of the resource. |
eTag |
string |
The ETag value to implement optimistic concurrency. |
formulation |
string |
Formulation description. Percentage or other unit of N, P, K, CA, MG, S, FE, MN, ZN, CU, B, MO, CL (based on the source, the available chemical elements can vary, but this is a typical list). |
id |
string |
Unique resource ID. |
location |
string |
Area where the chemical is used. This is important from a compliance perspective. |
modifiedBy |
string |
Modified by user/tenant id. |
modifiedDateTime |
string (date-time) |
Date-time when resource was last modified, sample format: yyyy-MM-ddTHH:mm:ssZ. |
name |
string minLength: 0maxLength: 100 |
Name to identify resource. |
product |
string |
Commercial product name of the chemical product. |
properties |
|
A collection of key value pairs that belongs to the resource. Each pair must not have a key greater than 50 characters and must not have a value greater than 150 characters. Note: A maximum of 25 key value pairs can be provided for a resource and only string, numeral and datetime (yyyy-MM-ddTHH:mm:ssZ) values are supported. |
reEntryInterval |
integer (int32) |
The number of days after which a person can visit the field after the chemical product is applied. |
reference |
Reference to a dataset record. |
|
registrationNumber |
string |
Registration number of the chemical. This could vary by geography. |
source |
string minLength: 2maxLength: 100 |
Source of the resource. |
specificGravity |
string |
Specific gravity details. |
state |
string |
Liquid/non Liquid. |
status |
string minLength: 0maxLength: 100 |
Status of the resource. |
type |
string |
Herbicide, Additive, Insecticides, Fertilizers. |
Company
Company/Manufacturer's details.
Name | Type | Description |
---|---|---|
description |
string |
Manufacturing Company description. |
name |
string |
Name of the manufacturing company. |
registrationNumber |
string |
Registration number of the company. |
Error
An error from the Azure AgPlatform service.
Name | Type | Description |
---|---|---|
code |
string minLength: 1 |
Server-defined set of error codes. |
details |
Error[] |
Array of details about specific errors that led to this reported error. |
innererror |
Inner error containing list of errors.See https://github.com/Microsoft/api-guidelines/blob/vNext/Guidelines.md#innererror--object for InnerError reference document. |
|
message |
string minLength: 1 |
Human-readable representation of the error. |
target |
string |
Target of the error. |
ErrorResponse
An error response from the Azure AgPlatform service. See https://github.com/Microsoft/api-guidelines/blob/vNext/Guidelines.md#7102-error-condition-responses for ErrorResponse reference document.
Name | Type | Description |
---|---|---|
error |
An error from the Azure AgPlatform service. |
|
traceId |
string |
Unique trace Id. |
InnerError
Inner error containing list of errors.See https://github.com/Microsoft/api-guidelines/blob/vNext/Guidelines.md#innererror--object for InnerError reference document.
Name | Type | Description |
---|---|---|
code |
string |
Specific error code than was provided by the containing error. |
innererror |
Inner error containing list of errors.See https://github.com/Microsoft/api-guidelines/blob/vNext/Guidelines.md#innererror--object for InnerError reference document. |
Reference
Reference to a dataset record.
Name | Type | Description |
---|---|---|
datasetId |
string minLength: 0maxLength: 100 |
Dataset id. |
recordId |
string minLength: 0maxLength: 100 |
Record id. |