Skip to main content

Farm

Definition

Farm Type
farm.json
{
"id": 0,
"countryID": 0,
"provinceID": 0,
"cityID": 0,
"districtID": 0,
"streetID": 0,
"corpsID": 0,
"farmName": "",
"address": "",
"farmDescription": "",
"lat": 0,
"lng": 0,
"status": 0,
"deletedAt": "",
"createdAt": "",
"updatedAt": "",
}

Get Farms

curl -X GET "https://${baseUrl}/farm/?\$filter=&\$orderBy=&\$page=1&\$pageSize=10" \
-H "Authorization: Bearer ${accessToken}" \
-H "Content-Type: application/json" \
-H "Accept: application/json"

Get Farm

curl -X GET "https://${baseUrl}/farm/${id}" \
-H "Authorization: Bearer ${accessToken}" \
-H "Content-Type: application/json" \
-H "Accept: application/json"

Apply Farm.ID

curl -X POST "https://${baseUrl}/apply/farm/id/" \
-H "Authorization: Bearer ${accessToken}" \
-H "Content-Type: application/json" \
-H "Accept: application/json"

Create Farm

curl -X POST "https://${baseUrl}/farm/" \
-H "Authorization: Bearer ${accessToken}" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d @farm.json
info
farm.json
{
"countryID": 0,
"provinceID": 0,
"cityID": 0,
"districtID": 0,
"streetID": 0,
"corpsID": 0,
"farmName": "",
"address": "",
"farmDescription": "",
"lat": 0,
"lng": 0,
"status": 0,
}
tip

success status: 201

Update Farm

curl -X PUT "https://${baseUrl}/farm/${id}" \
-H "Authorization: Bearer ${accessToken}" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d @farm.json
info
farm.json
{
"countryID": 0,
"provinceID": 0,
"cityID": 0,
"districtID": 0,
"streetID": 0,
"corpsID": 0,
"farmName": "",
"address": "",
"farmDescription": "",
"lat": 0,
"lng": 0,
"status": 0,
}

Update Farm Partial

curl -X PATCH "https://${baseUrl}/farm/${id}" \
-H "Authorization: Bearer ${accessToken}" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Attrs: countryID,provinceID,cityID,districtID,streetID,corpsID,farmName,address,farmDescription,lat,lng,status" \
-d @farm.json
info
farm.json
{
"countryID": 0,
"provinceID": 0,
"cityID": 0,
"districtID": 0,
"streetID": 0,
"corpsID": 0,
"farmName": "",
"address": "",
"farmDescription": "",
"lat": 0,
"lng": 0,
"status": 0,
}

Update Farm Status

curl -X PATCH "https://${baseUrl}/farm/${id}/status/" \
-H "Authorization: Bearer ${accessToken}" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d @farm.json
info
farm.json
{
"status": 0
}

Destroy Farm

curl -X DELETE "https://${baseUrl}/farm/${id}" \
-H "Authorization: Bearer ${accessToken}" \
-H "Content-Type: application/json" \
-H "Accept: application/json"
curl -X POST "https://${baseUrl}/farm/${id}/user/" \
-H "Authorization: Bearer ${accessToken}" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d "[1,2,3,4]"
curl -X DELETE "https://${baseUrl}/farm/${id}/user/" \
-H "Authorization: Bearer ${accessToken}" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d "[1,2,3,4]"