Introduction
This documentation aims to provide all the information you need to work with our API.
Authenticating requests
To authenticate requests, include an Authorization
header with the value "Bearer 1|Token"
.
All authenticated endpoints are marked with a requires authentication
badge in the documentation below.
You can retrieve your token can be obtained by contacting the administrator.
Note
Api for notes management
Get all notes
requires authentication
Retrieves a list of notes with optional filters and includes related user plant data.
Example request:
curl --request GET \
--get "https://leaflly.pl/api/v1/note" \
--header "Authorization: Bearer 1|Token" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
const url = new URL(
"https://leaflly.pl/api/v1/note"
);
const headers = {
"Authorization": "Bearer 1|Token",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
Example response (200):
{
"data": [
{
"id": 21,
"title": "repellendus",
"content": "Dolorem cupiditate mollitia consequuntur totam.",
"status": "aktywna",
"categories": "Wydarzenia",
"priority": 623699120,
"photo_path": null,
"user_plant_id": 2
},
{
"id": 22,
"title": "minima",
"content": "Et quas laborum quis quis ea repellat assumenda cumque.",
"status": "ważna",
"categories": "Środowisko",
"priority": 1867508646,
"photo_path": null,
"user_plant_id": 20
}
]
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Create a new note
requires authentication
Stores a new note record in the database based on the provided information.
Example request:
curl --request POST \
"https://leaflly.pl/api/v1/note" \
--header "Authorization: Bearer 1|Token" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"title\": \"bngqxwzmwfozkefgvxba\",
\"content\": \"suegneafkxndfvxvwkht\",
\"status\": \"tmkgnpexgudhssdhuwixniwiw\",
\"categories\": \"Podlewanie\",
\"priority\": 5,
\"photo_path\": \"jfvucovdgowaanljkcquvesl\",
\"user_plant_id\": 20
}"
const url = new URL(
"https://leaflly.pl/api/v1/note"
);
const headers = {
"Authorization": "Bearer 1|Token",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"title": "bngqxwzmwfozkefgvxba",
"content": "suegneafkxndfvxvwkht",
"status": "tmkgnpexgudhssdhuwixniwiw",
"categories": "Podlewanie",
"priority": 5,
"photo_path": "jfvucovdgowaanljkcquvesl",
"user_plant_id": 20
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Show a note
requires authentication
Retrieves detailed information about a specific note. Optionally includes related user plant data.
Example request:
curl --request GET \
--get "https://leaflly.pl/api/v1/note/1?includeUserPlant=1" \
--header "Authorization: Bearer 1|Token" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
const url = new URL(
"https://leaflly.pl/api/v1/note/1"
);
const params = {
"includeUserPlant": "1",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer 1|Token",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
Example response (200):
{
"data": {
"id": 23,
"title": "ut",
"content": "Ipsam quis atque vero et qui.",
"status": "inna",
"categories": "Historia rośliny",
"priority": 1811835657,
"photo_path": null,
"user_plant_id": 16
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Update a note
requires authentication
Updates the details of an existing note based on the provided information.
Example request:
curl --request PUT \
"https://leaflly.pl/api/v1/note/1" \
--header "Authorization: Bearer 1|Token" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"title\": \"civrc\",
\"content\": \"fki\",
\"status\": \"jxu\",
\"categories\": \"Lista zakupów\",
\"priority\": 4,
\"photo_path\": \"tfedcptejsfo\",
\"user_plant_id\": 16
}"
const url = new URL(
"https://leaflly.pl/api/v1/note/1"
);
const headers = {
"Authorization": "Bearer 1|Token",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"title": "civrc",
"content": "fki",
"status": "jxu",
"categories": "Lista zakupów",
"priority": 4,
"photo_path": "tfedcptejsfo",
"user_plant_id": 16
};
fetch(url, {
method: "PUT",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
Example response (200):
{
"data": {
"id": 24,
"title": "veritatis",
"content": null,
"status": "ważna",
"categories": "Inspiracje i pomysły",
"priority": 949816581,
"photo_path": null,
"user_plant_id": 13
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Delete a note
requires authentication
Removes a specified note from the database.
Example request:
curl --request DELETE \
"https://leaflly.pl/api/v1/note/1" \
--header "Authorization: Bearer 1|Token" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
const url = new URL(
"https://leaflly.pl/api/v1/note/1"
);
const headers = {
"Authorization": "Bearer 1|Token",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get Note Types
requires authentication
Retrieves a list of all available note types. This endpoint is useful for understanding the different types of notes that can be created or managed.
Example request:
curl --request GET \
--get "https://leaflly.pl/api/v1/note-types" \
--header "Authorization: Bearer 1|Token" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
const url = new URL(
"https://leaflly.pl/api/v1/note-types"
);
const headers = {
"Authorization": "Bearer 1|Token",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
{
"message": "Unauthenticated."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get Note Statuses
requires authentication
Retrieves a list of all possible statuses for notes. This endpoint helps in identifying the various stages or states a note can be in.
Example request:
curl --request GET \
--get "https://leaflly.pl/api/v1/note-statuses" \
--header "Authorization: Bearer 1|Token" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
const url = new URL(
"https://leaflly.pl/api/v1/note-statuses"
);
const headers = {
"Authorization": "Bearer 1|Token",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
{
"message": "Unauthenticated."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Notification
Api for notifications management
Get all notifications
requires authentication
Retrieves a list of notifications with optional filters and includes related user plant data.
Example request:
curl --request GET \
--get "https://leaflly.pl/api/v1/notification" \
--header "Authorization: Bearer 1|Token" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
const url = new URL(
"https://leaflly.pl/api/v1/notification"
);
const headers = {
"Authorization": "Bearer 1|Token",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
Example response (200):
{
"data": [
{
"id": 26,
"type": "Podlewanie",
"title": "Non aperiam omnis nemo rerum excepturi enim nemo.",
"message": "Asperiores quod occaecati est. Ut consequatur odio veniam rem qui. Harum eligendi inventore sit eum laborum laudantium. Ex est animi laboriosam eligendi.",
"notification_date": "2024-01-25 15:59:35",
"sent_on": null,
"created_at": "2024-01-14T21:54:26.000000Z",
"updated_at": "2024-01-14T21:54:26.000000Z"
},
{
"id": 27,
"type": "Przesadzanie",
"title": "Sint omnis quos nisi alias optio.",
"message": "Id cupiditate officia in est. Repudiandae quia cumque asperiores alias minus ut numquam. Eveniet suscipit corrupti consequuntur est. Quas eveniet iste mollitia esse doloremque itaque.",
"notification_date": "2024-01-25 13:59:20",
"sent_on": null,
"created_at": "2024-01-14T21:54:26.000000Z",
"updated_at": "2024-01-14T21:54:26.000000Z"
}
]
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Create a new notification
requires authentication
Creates a new notification and associates it with a specified user plant.
Example request:
curl --request POST \
"https://leaflly.pl/api/v1/notification" \
--header "Authorization: Bearer 1|Token" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"type\": \"fnpjwpghrub\",
\"title\": \"kulorr\",
\"message\": \"zlxdiyedt\",
\"notification_date\": \"2106-08-15\",
\"sent_on\": \"2024-01-14T21:54:26\",
\"user_plant_id\": 7
}"
const url = new URL(
"https://leaflly.pl/api/v1/notification"
);
const headers = {
"Authorization": "Bearer 1|Token",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"type": "fnpjwpghrub",
"title": "kulorr",
"message": "zlxdiyedt",
"notification_date": "2106-08-15",
"sent_on": "2024-01-14T21:54:26",
"user_plant_id": 7
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
Example response (200):
{
"data": {
"id": 28,
"type": "Podlewanie",
"title": "Rerum ipsum eveniet ad commodi aut et.",
"message": "Aperiam dolorem sit est rerum quae quae quo. Amet est id nesciunt. Enim natus laboriosam et consectetur vitae. Corrupti impedit et sed nesciunt.",
"notification_date": "2024-01-25 01:36:24",
"sent_on": null,
"created_at": "2024-01-14T21:54:26.000000Z",
"updated_at": "2024-01-14T21:54:26.000000Z"
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Show a notification
requires authentication
Retrieves details of a specific notification. Can optionally include associated user plant data.
Example request:
curl --request GET \
--get "https://leaflly.pl/api/v1/notification/1?includeUserPlants=1" \
--header "Authorization: Bearer 1|Token" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
const url = new URL(
"https://leaflly.pl/api/v1/notification/1"
);
const params = {
"includeUserPlants": "1",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer 1|Token",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
Example response (200):
{
"data": {
"id": 29,
"type": "Nawożenie",
"title": "Ut dolores dignissimos facere natus.",
"message": "Iusto facilis voluptatem architecto labore. Illo ducimus non qui voluptatum commodi ut exercitationem. Rerum animi hic excepturi saepe nisi dignissimos eveniet.",
"notification_date": "2024-01-24 03:54:35",
"sent_on": null,
"created_at": "2024-01-14T21:54:26.000000Z",
"updated_at": "2024-01-14T21:54:26.000000Z"
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Update a notification
requires authentication
Updates the specified notification with provided details.
Example request:
curl --request PUT \
"https://leaflly.pl/api/v1/notification/1" \
--header "Authorization: Bearer 1|Token" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"type\": null,
\"title\": null,
\"notification_date\": null,
\"sent_on\": null
}"
const url = new URL(
"https://leaflly.pl/api/v1/notification/1"
);
const headers = {
"Authorization": "Bearer 1|Token",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"type": null,
"title": null,
"notification_date": null,
"sent_on": null
};
fetch(url, {
method: "PUT",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
Example response (200):
{
"data": {
"id": 30,
"type": "Inne",
"title": "Id qui velit officia nemo delectus sint.",
"message": "Quod cum id unde animi quidem. Unde quas est ea qui aspernatur mollitia. Quidem et deleniti impedit assumenda deleniti facilis.",
"notification_date": "2024-01-26 03:51:57",
"sent_on": null,
"created_at": "2024-01-14T21:54:26.000000Z",
"updated_at": "2024-01-14T21:54:26.000000Z"
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Delete a notification
requires authentication
Permanently deletes the specified notification from the database. This action is irreversible.
Example request:
curl --request DELETE \
"https://leaflly.pl/api/v1/notification/1" \
--header "Authorization: Bearer 1|Token" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
const url = new URL(
"https://leaflly.pl/api/v1/notification/1"
);
const headers = {
"Authorization": "Bearer 1|Token",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get Notification Types
requires authentication
Retrieves a list of all available notification types. This endpoint is useful for understanding the different types of notifications that can be sent or received in the system.
Example request:
curl --request GET \
--get "https://leaflly.pl/api/v1/notification-types" \
--header "Authorization: Bearer 1|Token" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
const url = new URL(
"https://leaflly.pl/api/v1/notification-types"
);
const headers = {
"Authorization": "Bearer 1|Token",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
{
"message": "Unauthenticated."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Plant
Api for plants management
Get all plants
requires authentication
Retrieves a list of plants with optional filters and includes for related user plants.
Example request:
curl --request GET \
--get "https://leaflly.pl/api/v1/plant?search=%22Ficus%22" \
--header "Authorization: Bearer 1|Token" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
const url = new URL(
"https://leaflly.pl/api/v1/plant"
);
const params = {
"search": ""Ficus"",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer 1|Token",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
{
"message": "Unauthenticated."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Response
Response Fields
data
string[]
of plant resources.
links
Pagination links.
meta
Pagination meta information.
Create a new plant
requires authentication
Stores a new plant record in the database.
Example request:
curl --request POST \
"https://leaflly.pl/api/v1/plant" \
--header "Authorization: Bearer 1|Token" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"name\": \"psvqpf\",
\"description\": \"Et eligendi velit sed quia itaque dolor numquam illum.\",
\"species\": \"emcumbbiw\",
\"plant_type\": \"nppxerdzkxrsznqbalnu\",
\"image\": \"xugzdjqnhesgmyhnnc\",
\"soil_type\": \"eimdhqq\",
\"target_height\": \"aut\",
\"insolation\": \"mdvmgitulgetfihjqtv\",
\"cultivation_difficulty\": \"uvcqwuwhfzqyitprxcex\",
\"temperature\": \"qla\",
\"air_humidity\": \"hcttvqpouscbkniuc\",
\"toxicity\": 11,
\"ph\": \"ioxgyehtvguhoovfqgpnqzsrolqmx\"
}"
const url = new URL(
"https://leaflly.pl/api/v1/plant"
);
const headers = {
"Authorization": "Bearer 1|Token",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"name": "psvqpf",
"description": "Et eligendi velit sed quia itaque dolor numquam illum.",
"species": "emcumbbiw",
"plant_type": "nppxerdzkxrsznqbalnu",
"image": "xugzdjqnhesgmyhnnc",
"soil_type": "eimdhqq",
"target_height": "aut",
"insolation": "mdvmgitulgetfihjqtv",
"cultivation_difficulty": "uvcqwuwhfzqyitprxcex",
"temperature": "qla",
"air_humidity": "hcttvqpouscbkniuc",
"toxicity": 11,
"ph": "ioxgyehtvguhoovfqgpnqzsrolqmx"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Show a plant
requires authentication
Retrieves detailed information about a specific plant. Optionally includes related user plant data.
Example request:
curl --request GET \
--get "https://leaflly.pl/api/v1/plant/1?includeUserPlants=1" \
--header "Authorization: Bearer 1|Token" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
const url = new URL(
"https://leaflly.pl/api/v1/plant/1"
);
const params = {
"includeUserPlants": "1",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer 1|Token",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
Example response (200):
{
"data": {
"id": 49,
"name": "enim aut quis",
"description": "Quos voluptates in temporibus ut magnam eum quo ut.",
"species": "doloremque vel",
"plant_type": "Rośliny kwitnące",
"image": "https://via.placeholder.com/640x480.png/00bbee?text=libero",
"soil_type": "podłoże do uprawy hydroponicznej",
"target_height": "53",
"insolation": "półcień",
"cultivation_difficulty": "trudny",
"temperature": "25°C - 31°C",
"air_humidity": "36% - 63%",
"toxicity": 2,
"ph": "5.07 - 9.78",
"created_at": "2024-01-14T21:54:26.000000Z",
"updated_at": "2024-01-14T21:54:26.000000Z"
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Response
Response Fields
data
object
The data of the plant including optional user plants.
Update a plant
requires authentication
Updates the details of an existing plant based on the provided information.
Example request:
curl --request PUT \
"https://leaflly.pl/api/v1/plant/1" \
--header "Authorization: Bearer 1|Token" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"name\": \"iyyy\",
\"description\": \"Consequatur dolores dignissimos perferendis qui dolorem.\",
\"species\": \"thabzkkngbfzwbghigh\",
\"plant_type\": \"junn\",
\"image\": \"g\",
\"soil_type\": \"nlxhybgsu\",
\"target_height\": \"id\",
\"insolation\": \"pzarqusbdcgepxxeayi\",
\"cultivation_difficulty\": \"aosvcwsfzgs\",
\"temperature\": \"vygebmtzzu\",
\"air_humidity\": \"ynivwmka\",
\"toxicity\": 11,
\"ph\": \"asqkgyrdvyfcwziirxuhaouhgikkhnialsgsal\"
}"
const url = new URL(
"https://leaflly.pl/api/v1/plant/1"
);
const headers = {
"Authorization": "Bearer 1|Token",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"name": "iyyy",
"description": "Consequatur dolores dignissimos perferendis qui dolorem.",
"species": "thabzkkngbfzwbghigh",
"plant_type": "junn",
"image": "g",
"soil_type": "nlxhybgsu",
"target_height": "id",
"insolation": "pzarqusbdcgepxxeayi",
"cultivation_difficulty": "aosvcwsfzgs",
"temperature": "vygebmtzzu",
"air_humidity": "ynivwmka",
"toxicity": 11,
"ph": "asqkgyrdvyfcwziirxuhaouhgikkhnialsgsal"
};
fetch(url, {
method: "PUT",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
Example response (200):
{
"data": {
"id": 50,
"name": "rem qui voluptas",
"description": "Est cupiditate quas omnis quas est expedita.",
"species": "aut dignissimos",
"plant_type": "Rośliny pnące i zwisające",
"image": "https://via.placeholder.com/640x480.png/008888?text=autem",
"soil_type": "podłoże do uprawy hydroponicznej",
"target_height": "83",
"insolation": "półcień",
"cultivation_difficulty": "trudny",
"temperature": "11°C - 33°C",
"air_humidity": "42% - 56%",
"toxicity": 1,
"ph": "5.91 - 9.68",
"created_at": "2024-01-14T21:54:26.000000Z",
"updated_at": "2024-01-14T21:54:26.000000Z"
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Delete a plant
requires authentication
Removes a specified plant from the database.
Example request:
curl --request DELETE \
"https://leaflly.pl/api/v1/plant/1" \
--header "Authorization: Bearer 1|Token" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
const url = new URL(
"https://leaflly.pl/api/v1/plant/1"
);
const headers = {
"Authorization": "Bearer 1|Token",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get plant types
requires authentication
Returns an array of strings, each representing a distinct type of plant. This endpoint is useful for populating dropdowns or filters in the UI.
Example request:
curl --request GET \
--get "https://leaflly.pl/api/v1/plant-types" \
--header "Authorization: Bearer 1|Token" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
const url = new URL(
"https://leaflly.pl/api/v1/plant-types"
);
const headers = {
"Authorization": "Bearer 1|Token",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
{
"message": "Unauthenticated."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get Soil Types
requires authentication
Retrieves a list of all available soil types for plants. Useful for filters and understanding suitable soil conditions for different plants.
Example request:
curl --request GET \
--get "https://leaflly.pl/api/v1/soil-types" \
--header "Authorization: Bearer 1|Token" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
const url = new URL(
"https://leaflly.pl/api/v1/soil-types"
);
const headers = {
"Authorization": "Bearer 1|Token",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
{
"message": "Unauthenticated."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get Insolation Types
requires authentication
Retrieves a list of all available insolation types. This helps in understanding the amount and intensity of sunlight required by different plants.
Example request:
curl --request GET \
--get "https://leaflly.pl/api/v1/insolation-types" \
--header "Authorization: Bearer 1|Token" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
const url = new URL(
"https://leaflly.pl/api/v1/insolation-types"
);
const headers = {
"Authorization": "Bearer 1|Token",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
{
"message": "Unauthenticated."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get Difficulty Types
requires authentication
Retrieves a list of different difficulty levels for growing and maintaining plants. Useful for users to select plants based on their gardening experience.
Example request:
curl --request GET \
--get "https://leaflly.pl/api/v1/difficulty-types" \
--header "Authorization: Bearer 1|Token" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
const url = new URL(
"https://leaflly.pl/api/v1/difficulty-types"
);
const headers = {
"Authorization": "Bearer 1|Token",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
{
"message": "Unauthenticated."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Push notifications
Save Device Token
requires authentication
Saves the FCM device token to the authenticated user's profile.
Example request:
curl --request POST \
"https://leaflly.pl/api/v1/save-token" \
--header "Authorization: Bearer 1|Token" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"token\": \"your-device-token\"
}"
const url = new URL(
"https://leaflly.pl/api/v1/save-token"
);
const headers = {
"Authorization": "Bearer 1|Token",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"token": "your-device-token"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Send a Push Notification
requires authentication
Sends a push notification to a specified device token using Firebase Cloud Messaging (FCM).
Example request:
curl --request POST \
"https://leaflly.pl/api/v1/send-notification" \
--header "Authorization: Bearer 1|Token" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"deviceToken\": \"quibusdam\",
\"title\": \"nulla\",
\"body\": \"dolores\"
}"
const url = new URL(
"https://leaflly.pl/api/v1/send-notification"
);
const headers = {
"Authorization": "Bearer 1|Token",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"deviceToken": "quibusdam",
"title": "nulla",
"body": "dolores"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Send a Test Notification
requires authentication
Sends a test push notification to a specified device token. This endpoint is useful for testing the push notification functionality in the development environment.
Example request:
curl --request POST \
"https://leaflly.pl/api/v1/test-notification" \
--header "Authorization: Bearer 1|Token" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"token\": \"your-device-token\"
}"
const url = new URL(
"https://leaflly.pl/api/v1/test-notification"
);
const headers = {
"Authorization": "Bearer 1|Token",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"token": "your-device-token"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
User
Api for users management
Get all users
requires authentication
Retrieves a list of users with optional filters and includes for related user plants.
Example request:
curl --request GET \
--get "https://leaflly.pl/api/v1/user" \
--header "Authorization: Bearer 1|Token" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
const url = new URL(
"https://leaflly.pl/api/v1/user"
);
const headers = {
"Authorization": "Bearer 1|Token",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
Example response (200):
{
"data": [
{
"id": 42,
"name": "Karley Skiles",
"email": "kreiger.gust@example.org",
"email_verified_at": "2024-01-14T21:54:26.000000Z",
"created_at": "2024-01-14T21:54:26.000000Z",
"updated_at": "2024-01-14T21:54:26.000000Z"
},
{
"id": 43,
"name": "Prof. Myron Stoltenberg MD",
"email": "mbrown@example.com",
"email_verified_at": "2024-01-14T21:54:26.000000Z",
"created_at": "2024-01-14T21:54:26.000000Z",
"updated_at": "2024-01-14T21:54:26.000000Z"
}
]
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get a single user
requires authentication
Retrieves the details of a specific user and optionally includes related user plant data.
Example request:
curl --request GET \
--get "https://leaflly.pl/api/v1/user/1" \
--header "Authorization: Bearer 1|Token" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
const url = new URL(
"https://leaflly.pl/api/v1/user/1"
);
const headers = {
"Authorization": "Bearer 1|Token",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
Example response (200):
{
"data": {
"id": 44,
"name": "Nettie Sanford",
"email": "kschmitt@example.net",
"email_verified_at": "2024-01-14T21:54:26.000000Z",
"created_at": "2024-01-14T21:54:26.000000Z",
"updated_at": "2024-01-14T21:54:26.000000Z"
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Update a user
requires authentication
Updates the specified user's details. Fields are updated only if they are provided.
Example request:
curl --request PUT \
"https://leaflly.pl/api/v1/user/1" \
--header "Authorization: Bearer 1|Token" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"name\": \"lnvoikznhtzpvjhi\",
\"email\": \"dominique28@example.net\",
\"current_password\": \"currentPassword123\",
\"password\": \"qui\",
\"password_confirmation\": \"newPassword123\"
}"
const url = new URL(
"https://leaflly.pl/api/v1/user/1"
);
const headers = {
"Authorization": "Bearer 1|Token",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"name": "lnvoikznhtzpvjhi",
"email": "dominique28@example.net",
"current_password": "currentPassword123",
"password": "qui",
"password_confirmation": "newPassword123"
};
fetch(url, {
method: "PUT",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
Example response (200):
{
"data": {
"id": 45,
"name": "Fatima Heathcote",
"email": "karlie77@example.com",
"email_verified_at": "2024-01-14T21:54:26.000000Z",
"created_at": "2024-01-14T21:54:26.000000Z",
"updated_at": "2024-01-14T21:54:26.000000Z"
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Delete a user
requires authentication
Permanently deletes the specified user from the database. This action is irreversible.
Example request:
curl --request DELETE \
"https://leaflly.pl/api/v1/user/2" \
--header "Authorization: Bearer 1|Token" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
const url = new URL(
"https://leaflly.pl/api/v1/user/2"
);
const headers = {
"Authorization": "Bearer 1|Token",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
User Authentication
User authentication endpoints.
Logout user
requires authentication
Logs out the specified user by invalidating their access token.
Example request:
curl --request POST \
"https://leaflly.pl/api/v1/auth/logout" \
--header "Authorization: Bearer 1|Token" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"userId\": 2
}"
const url = new URL(
"https://leaflly.pl/api/v1/auth/logout"
);
const headers = {
"Authorization": "Bearer 1|Token",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"userId": 2
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
Example response (200):
{
"message": "User successfully logged out"
}
Example response (401):
{
"message": "Unauthenticated"
}
Example response (404):
{
"message": "User not found"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Register User
requires authentication
Register a new user.
Example request:
curl --request POST \
"https://leaflly.pl/api/auth/register" \
--header "Authorization: Bearer 1|Token" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"name\": \"natus\",
\"email\": \"hhickle@example.org\",
\"password\": \":}K*wGk&\",
\"password_confirmation\": null
}"
const url = new URL(
"https://leaflly.pl/api/auth/register"
);
const headers = {
"Authorization": "Bearer 1|Token",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"name": "natus",
"email": "hhickle@example.org",
"password": ":}K*wGk&",
"password_confirmation": null
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
Example response (200):
{
"status": true,
"message": "User Created Successfully",
"token": "API TOKEN"
}
Example response (401):
{
"status": false,
"message": "Validation error",
"errors": {}
}
Example response (500):
{
"status": false,
"message": "Internal Server Error"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Login User
requires authentication
Log in a user.
Example request:
curl --request POST \
"https://leaflly.pl/api/auth/login" \
--header "Authorization: Bearer 1|Token" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"email\": \"ygleichner@example.com\",
\"password\": \"FC|9NEA.7\\\"\"
}"
const url = new URL(
"https://leaflly.pl/api/auth/login"
);
const headers = {
"Authorization": "Bearer 1|Token",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"email": "ygleichner@example.com",
"password": "FC|9NEA.7\""
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
Example response (200):
{
"status": true,
"message": "User Logged In Successfully",
"token": "API TOKEN"
}
Example response (401):
{
"status": false,
"message": "Email & Password does not match with our record."
}
Example response (500):
{
"status": false,
"message": "Internal Server Error"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Forgot Password
requires authentication
Request a password reset link for a user with the given email.
Example request:
curl --request POST \
"https://leaflly.pl/api/forgot-password" \
--header "Authorization: Bearer 1|Token" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"email\": \"user@example.com\"
}"
const url = new URL(
"https://leaflly.pl/api/forgot-password"
);
const headers = {
"Authorization": "Bearer 1|Token",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"email": "user@example.com"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
Example response (200):
{
"status": "passwords.sent"
}
Example response (400):
{
"message": "Nie udało się wysłać linku resetującego hasło."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Verify a user's email address.
requires authentication
Verify the email address of a registered user using the provided $userId and $hash.
Example request:
curl --request GET \
--get "https://leaflly.pl/api/verify-email/quos/error" \
--header "Authorization: Bearer 1|Token" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
const url = new URL(
"https://leaflly.pl/api/verify-email/quos/error"
);
const headers = {
"Authorization": "Bearer 1|Token",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
Example response (404):
Show headers
cache-control: no-cache, private
content-type: application/json
x-ratelimit-limit: 6
x-ratelimit-remaining: 5
access-control-allow-origin: *
{
"message": "No query results for model [App\\Models\\User] quos"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Reset Password
requires authentication
Reset the user's password.
Example request:
curl --request POST \
"https://leaflly.pl/reset-password" \
--header "Authorization: Bearer 1|Token" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"token\": \"nesciunt\",
\"email\": \"rey.lind@example.org\",
\"password\": \"l@V}gP6BwIo^g\'*\",
\"password_confirmation\": \"doloribus\"
}"
const url = new URL(
"https://leaflly.pl/reset-password"
);
const headers = {
"Authorization": "Bearer 1|Token",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"token": "nesciunt",
"email": "rey.lind@example.org",
"password": "l@V}gP6BwIo^g'*",
"password_confirmation": "doloribus"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
Example response (200):
{
"message": "Hasło zostało zresetowane."
}
Example response (400):
{
"message": "Nie udało się zresetować hasła."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
UserPlants
Api for user plants management
Get all user plants
requires authentication
Retrieves a list of user plants with optional filters and includes for related entities.
Example request:
curl --request GET \
--get "https://leaflly.pl/api/v1/userPlant?search=%22Ficus%22" \
--header "Authorization: Bearer 1|Token" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"includePlant\": true,
\"includeNotes\": false,
\"includeUser\": false
}"
const url = new URL(
"https://leaflly.pl/api/v1/userPlant"
);
const params = {
"search": ""Ficus"",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer 1|Token",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"includePlant": true,
"includeNotes": false,
"includeUser": false
};
fetch(url, {
method: "GET",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
Example response (200):
{
"data": [
{
"id": 21,
"user_id": 1,
"plant_id": 43,
"custom_name": "amet non optio",
"location": "inna",
"last_watered": "2024-01-02 11:09:25",
"created_at": "2024-01-14T21:54:26.000000Z",
"updated_at": "2024-01-14T21:54:26.000000Z"
},
{
"id": 22,
"user_id": 39,
"plant_id": 2,
"custom_name": "voluptates voluptatem neque",
"location": "balkon",
"last_watered": "2024-01-03 08:56:40",
"created_at": "2024-01-14T21:54:26.000000Z",
"updated_at": "2024-01-14T21:54:26.000000Z"
}
]
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Store a newly created user's plant in storage.
requires authentication
Creates and stores a new user's plant in the database.
Example request:
curl --request POST \
"https://leaflly.pl/api/v1/userPlant" \
--header "Authorization: Bearer 1|Token" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"user_id\": 3,
\"plant_id\": 10,
\"custom_name\": \"oklknckkyjwayar\",
\"location\": \"rmsoshwaurrmwiwrmgkycydps\",
\"last_watered\": \"2024-01-14T21:54:26\"
}"
const url = new URL(
"https://leaflly.pl/api/v1/userPlant"
);
const headers = {
"Authorization": "Bearer 1|Token",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"user_id": 3,
"plant_id": 10,
"custom_name": "oklknckkyjwayar",
"location": "rmsoshwaurrmwiwrmgkycydps",
"last_watered": "2024-01-14T21:54:26"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
Example response (200):
{
"data": {
"id": 23,
"user_id": 23,
"plant_id": 6,
"custom_name": "repellendus velit veritatis",
"location": "łazienka",
"last_watered": "2024-01-02 12:32:59",
"created_at": "2024-01-14T21:54:26.000000Z",
"updated_at": "2024-01-14T21:54:26.000000Z"
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get a single UserPlant with relations
requires authentication
Retrieve a single UserPlant and optionally include its related entities such as notes and user details.
Example request:
curl --request GET \
--get "https://leaflly.pl/api/v1/userPlant/1?includePlant=1&includeNotes=1&includeUser=1" \
--header "Authorization: Bearer 1|Token" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"includePlant\": true,
\"includeNotes\": true,
\"includeUser\": true
}"
const url = new URL(
"https://leaflly.pl/api/v1/userPlant/1"
);
const params = {
"includePlant": "1",
"includeNotes": "1",
"includeUser": "1",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer 1|Token",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"includePlant": true,
"includeNotes": true,
"includeUser": true
};
fetch(url, {
method: "GET",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
Example response (200):
{
"data": {
"id": 24,
"user_id": 28,
"plant_id": 42,
"custom_name": "quo sit impedit",
"location": "pokój dzieci",
"last_watered": "2024-01-01 12:05:41",
"created_at": "2024-01-14T21:54:26.000000Z",
"updated_at": "2024-01-14T21:54:26.000000Z"
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Update a UserPlant
requires authentication
Update the details of a UserPlant with given ID. Allows updating the associated plant, user, custom name, location, and last watered date.
Example request:
curl --request PUT \
"https://leaflly.pl/api/v1/userPlant/1" \
--header "Authorization: Bearer 1|Token" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"user_id\": 20,
\"plant_id\": 19,
\"custom_name\": \"pghxhlryffcvomvhsfho\",
\"location\": \"sbqvfvnjrat\",
\"last_watered\": \"2024-01-14T21:54:26\"
}"
const url = new URL(
"https://leaflly.pl/api/v1/userPlant/1"
);
const headers = {
"Authorization": "Bearer 1|Token",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"user_id": 20,
"plant_id": 19,
"custom_name": "pghxhlryffcvomvhsfho",
"location": "sbqvfvnjrat",
"last_watered": "2024-01-14T21:54:26"
};
fetch(url, {
method: "PUT",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
Example response (200):
{
"data": {
"id": 25,
"user_id": 38,
"plant_id": 8,
"custom_name": "reprehenderit libero iure",
"location": "sypialnia",
"last_watered": "2024-01-06 22:48:03",
"created_at": "2024-01-14T21:54:26.000000Z",
"updated_at": "2024-01-14T21:54:26.000000Z"
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Remove a UserPlant
requires authentication
Removes a specified UserPlant resource from storage.
Example request:
curl --request DELETE \
"https://leaflly.pl/api/v1/userPlant/1" \
--header "Authorization: Bearer 1|Token" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
const url = new URL(
"https://leaflly.pl/api/v1/userPlant/1"
);
const headers = {
"Authorization": "Bearer 1|Token",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());
Example response (200):
{
"message": "Roślina użytkownika została pomyślnie usunięty."
}
Example response (404):
{
"message": "Nie znaleziono rośliny użytkownika o podanym identyfikatorze."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get Available Locations
requires authentication
Retrieves a list of all available locations where plants can be placed or are being maintained. This endpoint is useful for users looking to understand where they can place or find their plants.
Example request:
curl --request GET \
--get "https://leaflly.pl/api/v1/userPlant-locations" \
--header "Authorization: Bearer 1|Token" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
const url = new URL(
"https://leaflly.pl/api/v1/userPlant-locations"
);
const headers = {
"Authorization": "Bearer 1|Token",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
{
"message": "Unauthenticated."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
User Roles
Add a role to a user
requires authentication
Assigns a specified role to a user. Only accessible by administrators.
Example request:
curl --request POST \
"https://leaflly.pl/api/v1/users/1/roles" \
--header "Authorization: Bearer 1|Token" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"role\": \"editor\"
}"
const url = new URL(
"https://leaflly.pl/api/v1/users/1/roles"
);
const headers = {
"Authorization": "Bearer 1|Token",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"role": "editor"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
Example response (200, success):
{
"message": "Role added successfully"
}
Example response (404, role not found):
{
"message": "Role not found"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Remove a role from a user
requires authentication
Detaches a specified role from a user. Only accessible by administrators.
Example request:
curl --request DELETE \
"https://leaflly.pl/api/v1/users/1/roles/1" \
--header "Authorization: Bearer 1|Token" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
const url = new URL(
"https://leaflly.pl/api/v1/users/1/roles/1"
);
const headers = {
"Authorization": "Bearer 1|Token",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());
Example response (200, success):
{
"message": "Role removed successfully"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.