Browse developer docs
Issue a prescription map task
POSTprescription-create
Request
Send POST to /open/service with serviceName=prescription-create and the common signing parameters.
Send extra fields in the JSON body
Requires base64 protobuf, a base64 WebP, and WKT field geometry. The protobuf resolution is in centimetres. The outer data_type and inner protobuf dataType use different enumerations. Obtain the exact schema before serializing. API submission and XAG One’s native JSON upload use different formats.
This operation submits a change. Replace the illustrative values, confirm access, and review the intended action before sending a signed request.
{
"sn": "YOUR_DRONE_SN",
"prescription_proto_str": "<base64 serialized PrescriptionData>",
"prescription_name": "Your prescription name",
"prescription_guid": "YOUR_PRESCRIPTION_UUID",
"land_border": "<closed field polygon in WKT>",
"land_guid": "YOUR_FIELD_UUID",
"land_name": "Your field name",
"prescription_type": "WEEDING",
"prescription_img_str": "<base64 image.webp>",
"data_type": "1"
}| Parameter | Requirement | Meaning |
|---|---|---|
sn | Required | Authorized equipment serial number. |
prescription_proto_str | Required | Base64-encoded serialized PrescriptionData protobuf. |
prescription_name | Required | Display name of the prescription, up to 50 characters. |
prescription_guid | Required | Unique prescription GUID. |
land_border | Required | Closed field boundary encoded as WKT. |
land_guid | Required | Unique field GUID. |
land_name | Required | Display name of the field, up to 50 characters. |
prescription_type | Required | FERTILIZATION, WEEDING or FILL_SEEDLINGS. |
prescription_img_str | Required | Base64-encoded WebP image. |
data_type | Required | Outer request enum. Use 0 for binary or 1 for graded data. |
Encode the grid with this protobuf. The bounds are longitude and latitude. Resolution is in centimetres. The inner dataType uses 0 for default, 1 for binary or 2 for graded data.
syntax = "proto3";
package com.xag.xfarm.work.pojo.prescription;
message PrescriptionData {
float version = 1;
string guid = 2;
string name = 3;
double originLng = 4;
double originLat = 5;
double originEndLng = 6;
double originEndLat = 7;
uint32 rows = 8;
uint32 columns = 9;
int32 dataType = 10;
int32 resolution = 11;
repeated WeightData weight_data = 12;
}
message WeightData {
float data = 1;
}Response
The example success response has status 200, success true and data null. Check the target account and prescription preview separately before treating the map as ready to use.
Show example response fields and types
{
"success": "boolean",
"data": "null",
"message": "string",
"status": "number"
}