URL: https://web.fyta.de/api/auth/login
Method: POST
Body:
{
"email": "[email protected]",
"password": "examplepassword"
}
Response (200):
{
"access_token": "111111111111111111111111111111111111111",
"token_type": "Bearer",
"expires_in": 5184000,
"refresh_token": "2222222222222222222222222222222222222222",
"scope": "mobile"
}
expires_in is in seconds (60 days).
Errors:
| HTTP | When |
|---|---|
| 401 | Wrong password |
| 404 | No account with this email, or the account has no password (signed up with Apple/Google) |
| 422 | Invalid email/password format, or the account is not active |
The requests below require a Bearer authentication token: Authorization: Bearer <access_token>.
URL: https://web.fyta.de/api/user-plant
Method: GET
Response:
{
"gardens": [
{
"id": 123,
"garden_name": "Home",
"origin_path": null,
"thumb_path": null,
"mac_address": null
}
],
"plants": [
{
"id": 12,
"nickname": "Ficus benjamina 1",
"scientific_name": "Ficus benjamina",
"common_name": "Weeping fig",
"genus": null,
"status": 1,
"plant_id": 201,
"family_id": null,
"is_shared": false,
"owner": {},
"peers": [],
"lifecycle": {},
"plant_group": {},
"index": 0,
"wifi_status": 1,
"thumb_path": "<url>",
"origin_path": "<url>",
"plant_thumb_path": "<url>",
"plant_origin_path": "<url>",
"received_data_at": "2023-01-01 10:10:00",
"temperature_optimal_hours": 22,
"light_optimal_hours": 0,
"eligibility": true,
"air_humidity_status": 0,
"temperature_status": 3,
"light_status": 1,
"moisture_status": 3,
"salinity_status": 3,
"nutrients_status": 3,
"fertilisation": {
"last_fertilised_at": "2022-12-01 00:00:00",
"fertilise_at": "2023-02-01 00:00:00",
"was_repotted": false
},
"notifications": {
"light": true,
"temperature": true,
"water": true,
"nutrition": true,
"air_humidity": false
},
"care_tips_count": 0,
"has_remote_hub": false,
"has_remote_sensor": false,
"garden": {
"id": 123,
"name": "Home",
"index": 0
},
"sensor": {
"id": "AA:AA:AA:2B:AF:F4",
"device_type": 1,
"sensor_type_id": 1,
"has_sensor": true,
"status": 1,
"version": "0.30.0",
"is_battery_low": false,
"received_data_at": "2023-01-01 10:10:00",
"created_at": "2022-01-01 01:10:10",
"sensor_attached_at": "2022-01-01 01:10:10"
},
"sensors": [
{ "...": "same shape as sensor, one entry per sensor attached to the plant" }
],
"hub": {
"id": 123,
"hub_id": "AA:AA:AA:27:7D:6A",
"hub_name": "Living room",
"version": "1.2.0",
"status": 1,
"received_data_at": "2023-01-01 10:10:00",
"reached_hub_at": "2023-01-01 10:10:01"
}
}
],
"plantOverview": {
"doingGreat": 1,
"needHelp": 0,
"analysing": 0,
"outdated": 0,
"silent": 0,
"noBeam": 0
},
"hubs_with_lost_connection": [
{
"id": 124,
"mac": "AA:AA:AA:27:7D:6B",
"name": "Bedroom"
}
]
}
Notes:
plants contains the user's own plants and plants shared with them (is_shared: true, with user). Shared plants get an extra entry in gardens with is_shared: true and the users id/name.sensor and hub are null when the plant has none; garden is null when the plant is in no garden.