Farm
Definition
Farm Type
- JSON
- Typescript
- Kotlin
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
- Typescript
- Kotlin
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
- Typescript
- Kotlin
curl -X GET "https://${baseUrl}/farm/${id}" \
-H "Authorization: Bearer ${accessToken}" \
-H "Content-Type: application/json" \
-H "Accept: application/json"
Apply Farm.ID
- Curl
- Typescript
- Kotlin
curl -X POST "https://${baseUrl}/apply/farm/id/" \
-H "Authorization: Bearer ${accessToken}" \
-H "Content-Type: application/json" \
-H "Accept: application/json"
Create Farm
- Curl
- Typescript
- Kotlin
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
- Typescript
- Kotlin
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
- Typescript
- Kotlin
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
- Typescript
- Kotlin
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
- Typescript
- Kotlin
curl -X DELETE "https://${baseUrl}/farm/${id}" \
-H "Authorization: Bearer ${accessToken}" \
-H "Content-Type: application/json" \
-H "Accept: application/json"
Link Users
- Curl
- Typescript
- Kotlin
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]"
UnLink Users
- Curl
- Typescript
- Kotlin
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]"