Introduction
This documentation aims to provide all the information you need to work with our API.
Authenticating requests
This API is not authenticated.
Authentication
Register
Example request:
curl --request POST \
"https://farmart.test/api/v1/register" \
--header "Authorization: Bearer {token}" \
--header "Api-Version: v1" \
--header "Content-Type: application/json" \
--data "{
\"first_name\": \"cupiditate\",
\"last_name\": \"voluptas\",
\"email\": \"moen.daron@example.com\",
\"password\": \"|7>&WrhKQ\",
\"phone\": \"eaque\",
\"password_confirmation\": \"aliquam\"
}"
const url = new URL(
"https://farmart.test/api/v1/register"
);
const headers = {
"Authorization": "Bearer {token}",
"Api-Version": "v1",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"first_name": "cupiditate",
"last_name": "voluptas",
"email": "moen.daron@example.com",
"password": "|7>&WrhKQ",
"phone": "eaque",
"password_confirmation": "aliquam"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
Example response (200):
{
"error": false,
"data": null,
"message": "Registered successfully! We emailed you to verify your account!"
}
Example response (422):
{
"message": "The given data was invalid.",
"errors": {
"first_name": [
"The first name field is required."
],
"last_name": [
"The last name field is required."
],
"email": [
"The email field is required."
],
"password": [
"The password field is required."
]
}
}
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
Example request:
curl --request POST \
"https://farmart.test/api/v1/login" \
--header "Authorization: Bearer {token}" \
--header "Api-Version: v1" \
--header "Content-Type: application/json" \
--data "{
\"email\": \"bswaniawski@example.net\",
\"password\": \"f_~7THR\\\\OC|rM)\",
\"login\": \"esse\"
}"
const url = new URL(
"https://farmart.test/api/v1/login"
);
const headers = {
"Authorization": "Bearer {token}",
"Api-Version": "v1",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"email": "bswaniawski@example.net",
"password": "f_~7THR\\OC|rM)",
"login": "esse"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
Example response (200):
{
"error": false,
"data": {
"token": "1|aF5s7p3xxx1lVL8hkSrPN72m4wPVpTvTs..."
},
"message": null
}
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
Send a reset link to the given user.
Example request:
curl --request POST \
"https://farmart.test/api/v1/password/forgot" \
--header "Authorization: Bearer {token}" \
--header "Api-Version: v1" \
--header "Content-Type: application/json" \
--data "{
\"email\": \"rhiannon.windler@example.org\"
}"
const url = new URL(
"https://farmart.test/api/v1/password/forgot"
);
const headers = {
"Authorization": "Bearer {token}",
"Api-Version": "v1",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"email": "rhiannon.windler@example.org"
};
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.
Resend email verification
Resend the email verification notification.
Example request:
curl --request POST \
"https://farmart.test/api/v1/resend-verify-account-email" \
--header "Authorization: Bearer {token}" \
--header "Api-Version: v1" \
--header "Content-Type: application/json" \
--data "{
\"email\": \"marcelle.bergnaum@example.net\"
}"
const url = new URL(
"https://farmart.test/api/v1/resend-verify-account-email"
);
const headers = {
"Authorization": "Bearer {token}",
"Api-Version": "v1",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"email": "marcelle.bergnaum@example.net"
};
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.
Logout
requires authentication
Example request:
curl --request GET \
--get "https://farmart.test/api/v1/logout" \
--header "Authorization: Bearer {token}" \
--header "Api-Version: v1"
const url = new URL(
"https://farmart.test/api/v1/logout"
);
const headers = {
"Authorization": "Bearer {token}",
"Api-Version": "v1",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
Example response (302):
Show headers
cache-control: no-cache, private
location: https://farmart.test/login
content-type: text/html; charset=UTF-8
access-control-allow-origin: *
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<meta http-equiv="refresh" content="0;url='https://farmart.test/login'" />
<title>Redirecting to https://farmart.test/login</title>
</head>
<body>
Redirecting to <a href="https://farmart.test/login">https://farmart.test/login</a>.
</body>
</html>
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.
Blog
Search post
Example request:
curl --request GET \
--get "https://farmart.test/api/v1/search" \
--header "Authorization: Bearer {token}" \
--header "Api-Version: v1" \
--header "Content-Type: application/json" \
--data "{
\"q\": \"neque\"
}"
const url = new URL(
"https://farmart.test/api/v1/search"
);
const headers = {
"Authorization": "Bearer {token}",
"Api-Version": "v1",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"q": "neque"
};
fetch(url, {
method: "GET",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
Example response (200):
Show headers
cache-control: no-cache, private
content-type: application/json
x-ratelimit-limit: 60
x-ratelimit-remaining: 59
access-control-allow-origin: *
{
"error": true,
"data": null,
"message": "No results found, please try with different keywords."
}
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.
List posts
Example request:
curl --request GET \
--get "https://farmart.test/api/v1/posts" \
--header "Authorization: Bearer {token}" \
--header "Api-Version: v1"
const url = new URL(
"https://farmart.test/api/v1/posts"
);
const headers = {
"Authorization": "Bearer {token}",
"Api-Version": "v1",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
Example response (200):
Show headers
cache-control: no-cache, private
content-type: application/json
x-ratelimit-limit: 60
x-ratelimit-remaining: 58
access-control-allow-origin: *
{
"data": [
{
"id": 1,
"name": "4 Expert Tips On How To Choose The Right Men’s Wallet",
"slug": "4-expert-tips-on-how-to-choose-the-right-mens-wallet",
"description": "You should pay more attention when you choose your wallets. There are a lot of them on the market with the different designs and styles. When you choose carefully, you would be able to buy a wallet that is catered to your needs. Not to mention that it will help to enhance your style significantly.",
"image": "https://farmart.test/storage/news/1.jpg",
"categories": [
{
"id": 2,
"name": "Fashion",
"slug": "fashion",
"url": "https://farmart.test/blog/fashion",
"description": "Enim accusamus aut porro animi. Reprehenderit et vero perferendis earum quisquam quidem. Facere iste atque ipsum."
},
{
"id": 3,
"name": "Electronic",
"slug": "electronic",
"url": "https://farmart.test/blog/electronic",
"description": "Qui rerum ut impedit dolorem odio. Magnam non cupiditate et soluta placeat a id voluptatem. Dolores totam enim eveniet deserunt et architecto magnam."
}
],
"tags": [
{
"id": 1,
"name": "General",
"slug": "general",
"description": ""
},
{
"id": 2,
"name": "Design",
"slug": "design",
"description": ""
},
{
"id": 3,
"name": "Fashion",
"slug": "fashion",
"description": ""
},
{
"id": 4,
"name": "Branding",
"slug": "branding",
"description": ""
},
{
"id": 5,
"name": "Modern",
"slug": "modern",
"description": ""
}
],
"created_at": "2023-12-07T10:27:16.000000Z",
"updated_at": "2023-12-07T10:27:16.000000Z"
},
{
"id": 2,
"name": "Sexy Clutches: How to Buy & Wear a Designer Clutch Bag",
"slug": "sexy-clutches-how-to-buy-wear-a-designer-clutch-bag",
"description": "You should pay more attention when you choose your wallets. There are a lot of them on the market with the different designs and styles. When you choose carefully, you would be able to buy a wallet that is catered to your needs. Not to mention that it will help to enhance your style significantly.",
"image": "https://farmart.test/storage/news/2.jpg",
"categories": [
{
"id": 1,
"name": "Ecommerce",
"slug": "ecommerce",
"url": "https://farmart.test/blog/ecommerce",
"description": "Qui dolores minus quia. Incidunt et et veniam sequi illum dolor. Quis rerum ullam harum ipsum voluptas eveniet."
},
{
"id": 4,
"name": "Commercial",
"slug": "commercial",
"url": "https://farmart.test/blog/commercial",
"description": "Porro quia ipsa quidem laborum dolor. Quia ut eum dolores. In debitis illo ut. Possimus dolores dicta vel quae."
}
],
"tags": [
{
"id": 1,
"name": "General",
"slug": "general",
"description": ""
},
{
"id": 2,
"name": "Design",
"slug": "design",
"description": ""
},
{
"id": 3,
"name": "Fashion",
"slug": "fashion",
"description": ""
},
{
"id": 4,
"name": "Branding",
"slug": "branding",
"description": ""
},
{
"id": 5,
"name": "Modern",
"slug": "modern",
"description": ""
}
],
"created_at": "2023-12-07T10:27:16.000000Z",
"updated_at": "2023-12-07T10:27:16.000000Z"
},
{
"id": 3,
"name": "The Top 2020 Handbag Trends to Know",
"slug": "the-top-2020-handbag-trends-to-know",
"description": "You should pay more attention when you choose your wallets. There are a lot of them on the market with the different designs and styles. When you choose carefully, you would be able to buy a wallet that is catered to your needs. Not to mention that it will help to enhance your style significantly.",
"image": "https://farmart.test/storage/news/3.jpg",
"categories": [
{
"id": 1,
"name": "Ecommerce",
"slug": "ecommerce",
"url": "https://farmart.test/blog/ecommerce",
"description": "Qui dolores minus quia. Incidunt et et veniam sequi illum dolor. Quis rerum ullam harum ipsum voluptas eveniet."
},
{
"id": 4,
"name": "Commercial",
"slug": "commercial",
"url": "https://farmart.test/blog/commercial",
"description": "Porro quia ipsa quidem laborum dolor. Quia ut eum dolores. In debitis illo ut. Possimus dolores dicta vel quae."
}
],
"tags": [
{
"id": 1,
"name": "General",
"slug": "general",
"description": ""
},
{
"id": 2,
"name": "Design",
"slug": "design",
"description": ""
},
{
"id": 3,
"name": "Fashion",
"slug": "fashion",
"description": ""
},
{
"id": 4,
"name": "Branding",
"slug": "branding",
"description": ""
},
{
"id": 5,
"name": "Modern",
"slug": "modern",
"description": ""
}
],
"created_at": "2023-12-07T10:27:16.000000Z",
"updated_at": "2023-12-07T10:27:16.000000Z"
},
{
"id": 4,
"name": "How to Match the Color of Your Handbag With an Outfit",
"slug": "how-to-match-the-color-of-your-handbag-with-an-outfit",
"description": "You should pay more attention when you choose your wallets. There are a lot of them on the market with the different designs and styles. When you choose carefully, you would be able to buy a wallet that is catered to your needs. Not to mention that it will help to enhance your style significantly.",
"image": "https://farmart.test/storage/news/4.jpg",
"categories": [
{
"id": 2,
"name": "Fashion",
"slug": "fashion",
"url": "https://farmart.test/blog/fashion",
"description": "Enim accusamus aut porro animi. Reprehenderit et vero perferendis earum quisquam quidem. Facere iste atque ipsum."
},
{
"id": 4,
"name": "Commercial",
"slug": "commercial",
"url": "https://farmart.test/blog/commercial",
"description": "Porro quia ipsa quidem laborum dolor. Quia ut eum dolores. In debitis illo ut. Possimus dolores dicta vel quae."
}
],
"tags": [
{
"id": 1,
"name": "General",
"slug": "general",
"description": ""
},
{
"id": 2,
"name": "Design",
"slug": "design",
"description": ""
},
{
"id": 3,
"name": "Fashion",
"slug": "fashion",
"description": ""
},
{
"id": 4,
"name": "Branding",
"slug": "branding",
"description": ""
},
{
"id": 5,
"name": "Modern",
"slug": "modern",
"description": ""
}
],
"created_at": "2023-12-07T10:27:16.000000Z",
"updated_at": "2023-12-07T10:27:16.000000Z"
},
{
"id": 5,
"name": "How to Care for Leather Bags",
"slug": "how-to-care-for-leather-bags",
"description": "You should pay more attention when you choose your wallets. There are a lot of them on the market with the different designs and styles. When you choose carefully, you would be able to buy a wallet that is catered to your needs. Not to mention that it will help to enhance your style significantly.",
"image": "https://farmart.test/storage/news/5.jpg",
"categories": [
{
"id": 2,
"name": "Fashion",
"slug": "fashion",
"url": "https://farmart.test/blog/fashion",
"description": "Enim accusamus aut porro animi. Reprehenderit et vero perferendis earum quisquam quidem. Facere iste atque ipsum."
},
{
"id": 4,
"name": "Commercial",
"slug": "commercial",
"url": "https://farmart.test/blog/commercial",
"description": "Porro quia ipsa quidem laborum dolor. Quia ut eum dolores. In debitis illo ut. Possimus dolores dicta vel quae."
}
],
"tags": [
{
"id": 1,
"name": "General",
"slug": "general",
"description": ""
},
{
"id": 2,
"name": "Design",
"slug": "design",
"description": ""
},
{
"id": 3,
"name": "Fashion",
"slug": "fashion",
"description": ""
},
{
"id": 4,
"name": "Branding",
"slug": "branding",
"description": ""
},
{
"id": 5,
"name": "Modern",
"slug": "modern",
"description": ""
}
],
"created_at": "2023-12-07T10:27:16.000000Z",
"updated_at": "2023-12-07T10:27:16.000000Z"
},
{
"id": 6,
"name": "We're Crushing Hard on Summer's 10 Biggest Bag Trends",
"slug": "were-crushing-hard-on-summers-10-biggest-bag-trends",
"description": "You should pay more attention when you choose your wallets. There are a lot of them on the market with the different designs and styles. When you choose carefully, you would be able to buy a wallet that is catered to your needs. Not to mention that it will help to enhance your style significantly.",
"image": "https://farmart.test/storage/news/6.jpg",
"categories": [
{
"id": 2,
"name": "Fashion",
"slug": "fashion",
"url": "https://farmart.test/blog/fashion",
"description": "Enim accusamus aut porro animi. Reprehenderit et vero perferendis earum quisquam quidem. Facere iste atque ipsum."
},
{
"id": 3,
"name": "Electronic",
"slug": "electronic",
"url": "https://farmart.test/blog/electronic",
"description": "Qui rerum ut impedit dolorem odio. Magnam non cupiditate et soluta placeat a id voluptatem. Dolores totam enim eveniet deserunt et architecto magnam."
}
],
"tags": [
{
"id": 1,
"name": "General",
"slug": "general",
"description": ""
},
{
"id": 2,
"name": "Design",
"slug": "design",
"description": ""
},
{
"id": 3,
"name": "Fashion",
"slug": "fashion",
"description": ""
},
{
"id": 4,
"name": "Branding",
"slug": "branding",
"description": ""
},
{
"id": 5,
"name": "Modern",
"slug": "modern",
"description": ""
}
],
"created_at": "2023-12-07T10:27:16.000000Z",
"updated_at": "2023-12-07T10:27:16.000000Z"
},
{
"id": 7,
"name": "Essential Qualities of Highly Successful Music",
"slug": "essential-qualities-of-highly-successful-music",
"description": "You should pay more attention when you choose your wallets. There are a lot of them on the market with the different designs and styles. When you choose carefully, you would be able to buy a wallet that is catered to your needs. Not to mention that it will help to enhance your style significantly.",
"image": "https://farmart.test/storage/news/7.jpg",
"categories": [
{
"id": 2,
"name": "Fashion",
"slug": "fashion",
"url": "https://farmart.test/blog/fashion",
"description": "Enim accusamus aut porro animi. Reprehenderit et vero perferendis earum quisquam quidem. Facere iste atque ipsum."
},
{
"id": 3,
"name": "Electronic",
"slug": "electronic",
"url": "https://farmart.test/blog/electronic",
"description": "Qui rerum ut impedit dolorem odio. Magnam non cupiditate et soluta placeat a id voluptatem. Dolores totam enim eveniet deserunt et architecto magnam."
}
],
"tags": [
{
"id": 1,
"name": "General",
"slug": "general",
"description": ""
},
{
"id": 2,
"name": "Design",
"slug": "design",
"description": ""
},
{
"id": 3,
"name": "Fashion",
"slug": "fashion",
"description": ""
},
{
"id": 4,
"name": "Branding",
"slug": "branding",
"description": ""
},
{
"id": 5,
"name": "Modern",
"slug": "modern",
"description": ""
}
],
"created_at": "2023-12-07T10:27:16.000000Z",
"updated_at": "2023-12-07T10:27:16.000000Z"
},
{
"id": 8,
"name": "9 Things I Love About Shaving My Head",
"slug": "9-things-i-love-about-shaving-my-head",
"description": "You should pay more attention when you choose your wallets. There are a lot of them on the market with the different designs and styles. When you choose carefully, you would be able to buy a wallet that is catered to your needs. Not to mention that it will help to enhance your style significantly.",
"image": "https://farmart.test/storage/news/8.jpg",
"categories": [
{
"id": 1,
"name": "Ecommerce",
"slug": "ecommerce",
"url": "https://farmart.test/blog/ecommerce",
"description": "Qui dolores minus quia. Incidunt et et veniam sequi illum dolor. Quis rerum ullam harum ipsum voluptas eveniet."
},
{
"id": 4,
"name": "Commercial",
"slug": "commercial",
"url": "https://farmart.test/blog/commercial",
"description": "Porro quia ipsa quidem laborum dolor. Quia ut eum dolores. In debitis illo ut. Possimus dolores dicta vel quae."
}
],
"tags": [
{
"id": 1,
"name": "General",
"slug": "general",
"description": ""
},
{
"id": 2,
"name": "Design",
"slug": "design",
"description": ""
},
{
"id": 3,
"name": "Fashion",
"slug": "fashion",
"description": ""
},
{
"id": 4,
"name": "Branding",
"slug": "branding",
"description": ""
},
{
"id": 5,
"name": "Modern",
"slug": "modern",
"description": ""
}
],
"created_at": "2023-12-07T10:27:16.000000Z",
"updated_at": "2023-12-07T10:27:16.000000Z"
},
{
"id": 9,
"name": "Why Teamwork Really Makes The Dream Work",
"slug": "why-teamwork-really-makes-the-dream-work",
"description": "You should pay more attention when you choose your wallets. There are a lot of them on the market with the different designs and styles. When you choose carefully, you would be able to buy a wallet that is catered to your needs. Not to mention that it will help to enhance your style significantly.",
"image": "https://farmart.test/storage/news/9.jpg",
"categories": [
{
"id": 1,
"name": "Ecommerce",
"slug": "ecommerce",
"url": "https://farmart.test/blog/ecommerce",
"description": "Qui dolores minus quia. Incidunt et et veniam sequi illum dolor. Quis rerum ullam harum ipsum voluptas eveniet."
},
{
"id": 4,
"name": "Commercial",
"slug": "commercial",
"url": "https://farmart.test/blog/commercial",
"description": "Porro quia ipsa quidem laborum dolor. Quia ut eum dolores. In debitis illo ut. Possimus dolores dicta vel quae."
}
],
"tags": [
{
"id": 1,
"name": "General",
"slug": "general",
"description": ""
},
{
"id": 2,
"name": "Design",
"slug": "design",
"description": ""
},
{
"id": 3,
"name": "Fashion",
"slug": "fashion",
"description": ""
},
{
"id": 4,
"name": "Branding",
"slug": "branding",
"description": ""
},
{
"id": 5,
"name": "Modern",
"slug": "modern",
"description": ""
}
],
"created_at": "2023-12-07T10:27:16.000000Z",
"updated_at": "2023-12-07T10:27:16.000000Z"
},
{
"id": 10,
"name": "The World Caters to Average People",
"slug": "the-world-caters-to-average-people",
"description": "You should pay more attention when you choose your wallets. There are a lot of them on the market with the different designs and styles. When you choose carefully, you would be able to buy a wallet that is catered to your needs. Not to mention that it will help to enhance your style significantly.",
"image": "https://farmart.test/storage/news/10.jpg",
"categories": [
{
"id": 2,
"name": "Fashion",
"slug": "fashion",
"url": "https://farmart.test/blog/fashion",
"description": "Enim accusamus aut porro animi. Reprehenderit et vero perferendis earum quisquam quidem. Facere iste atque ipsum."
},
{
"id": 4,
"name": "Commercial",
"slug": "commercial",
"url": "https://farmart.test/blog/commercial",
"description": "Porro quia ipsa quidem laborum dolor. Quia ut eum dolores. In debitis illo ut. Possimus dolores dicta vel quae."
}
],
"tags": [
{
"id": 1,
"name": "General",
"slug": "general",
"description": ""
},
{
"id": 2,
"name": "Design",
"slug": "design",
"description": ""
},
{
"id": 3,
"name": "Fashion",
"slug": "fashion",
"description": ""
},
{
"id": 4,
"name": "Branding",
"slug": "branding",
"description": ""
},
{
"id": 5,
"name": "Modern",
"slug": "modern",
"description": ""
}
],
"created_at": "2023-12-07T10:27:16.000000Z",
"updated_at": "2023-12-07T10:27:16.000000Z"
}
],
"links": {
"first": "https://farmart.test/api/v1/posts?page=1",
"last": "https://farmart.test/api/v1/posts?page=2",
"prev": null,
"next": "https://farmart.test/api/v1/posts?page=2"
},
"meta": {
"current_page": 1,
"from": 1,
"last_page": 2,
"links": [
{
"url": null,
"label": "« Previous",
"active": false
},
{
"url": "https://farmart.test/api/v1/posts?page=1",
"label": "1",
"active": true
},
{
"url": "https://farmart.test/api/v1/posts?page=2",
"label": "2",
"active": false
},
{
"url": "https://farmart.test/api/v1/posts?page=2",
"label": "Next »",
"active": false
}
],
"path": "https://farmart.test/api/v1/posts",
"per_page": 10,
"to": 10,
"total": 11
},
"error": false,
"message": null
}
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.
List categories
Example request:
curl --request GET \
--get "https://farmart.test/api/v1/categories" \
--header "Authorization: Bearer {token}" \
--header "Api-Version: v1"
const url = new URL(
"https://farmart.test/api/v1/categories"
);
const headers = {
"Authorization": "Bearer {token}",
"Api-Version": "v1",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
Example response (200):
Show headers
cache-control: no-cache, private
content-type: application/json
x-ratelimit-limit: 60
x-ratelimit-remaining: 57
access-control-allow-origin: *
{
"data": [
{
"id": 4,
"name": "Commercial",
"slug": "commercial",
"description": "Porro quia ipsa quidem laborum dolor. Quia ut eum dolores. In debitis illo ut. Possimus dolores dicta vel quae.",
"children": [],
"parent": {
"id": null,
"name": "",
"slug": "",
"url": "https://farmart.test",
"description": ""
}
},
{
"id": 3,
"name": "Electronic",
"slug": "electronic",
"description": "Qui rerum ut impedit dolorem odio. Magnam non cupiditate et soluta placeat a id voluptatem. Dolores totam enim eveniet deserunt et architecto magnam.",
"children": [],
"parent": {
"id": null,
"name": "",
"slug": "",
"url": "https://farmart.test",
"description": ""
}
},
{
"id": 2,
"name": "Fashion",
"slug": "fashion",
"description": "Enim accusamus aut porro animi. Reprehenderit et vero perferendis earum quisquam quidem. Facere iste atque ipsum.",
"children": [],
"parent": {
"id": null,
"name": "",
"slug": "",
"url": "https://farmart.test",
"description": ""
}
},
{
"id": 1,
"name": "Ecommerce",
"slug": "ecommerce",
"description": "Qui dolores minus quia. Incidunt et et veniam sequi illum dolor. Quis rerum ullam harum ipsum voluptas eveniet.",
"children": [],
"parent": {
"id": null,
"name": "",
"slug": "",
"url": "https://farmart.test",
"description": ""
}
}
],
"links": {
"first": "https://farmart.test/api/v1/categories?page=1",
"last": "https://farmart.test/api/v1/categories?page=1",
"prev": null,
"next": null
},
"meta": {
"current_page": 1,
"from": 1,
"last_page": 1,
"links": [
{
"url": null,
"label": "« Previous",
"active": false
},
{
"url": "https://farmart.test/api/v1/categories?page=1",
"label": "1",
"active": true
},
{
"url": null,
"label": "Next »",
"active": false
}
],
"path": "https://farmart.test/api/v1/categories",
"per_page": 10,
"to": 4,
"total": 4
},
"error": false,
"message": null
}
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.
List tags
Filters posts
Example request:
curl --request GET \
--get "https://farmart.test/api/v1/posts/filters?page=19&per_page=13&search=voluptatum&after=amet&author=eveniet&author_exclude=eius&before=omnis&exclude=laudantium&include=consequatur&order=vero&order_by=magni&categories=quae&categories_exclude=est&tags=ab&tags_exclude=beatae&featured=consequatur" \
--header "Authorization: Bearer {token}" \
--header "Api-Version: v1"
const url = new URL(
"https://farmart.test/api/v1/posts/filters"
);
const params = {
"page": "19",
"per_page": "13",
"search": "voluptatum",
"after": "amet",
"author": "eveniet",
"author_exclude": "eius",
"before": "omnis",
"exclude": "laudantium",
"include": "consequatur",
"order": "vero",
"order_by": "magni",
"categories": "quae",
"categories_exclude": "est",
"tags": "ab",
"tags_exclude": "beatae",
"featured": "consequatur",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {token}",
"Api-Version": "v1",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
Example response (200):
Show headers
cache-control: no-cache, private
content-type: application/json
x-ratelimit-limit: 60
x-ratelimit-remaining: 55
access-control-allow-origin: *
{
"data": [],
"links": {
"first": "https://farmart.test/api/v1/posts/filters?page=1",
"last": "https://farmart.test/api/v1/posts/filters?page=1",
"prev": "https://farmart.test/api/v1/posts/filters?page=18",
"next": null
},
"meta": {
"current_page": 19,
"from": null,
"last_page": 1,
"links": [
{
"url": "https://farmart.test/api/v1/posts/filters?page=18",
"label": "« Previous",
"active": false
},
{
"url": "https://farmart.test/api/v1/posts/filters?page=1",
"label": "1",
"active": false
},
{
"url": null,
"label": "Next »",
"active": false
}
],
"path": "https://farmart.test/api/v1/posts/filters",
"per_page": 13,
"to": null,
"total": 0
},
"error": false,
"message": null
}
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 post by slug
Example request:
curl --request GET \
--get "https://farmart.test/api/v1/posts/aut?slug=dicta" \
--header "Authorization: Bearer {token}" \
--header "Api-Version: v1"
const url = new URL(
"https://farmart.test/api/v1/posts/aut"
);
const params = {
"slug": "dicta",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {token}",
"Api-Version": "v1",
"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: 60
x-ratelimit-remaining: 54
access-control-allow-origin: *
{
"error": true,
"data": null,
"message": "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.
Filters categories
Example request:
curl --request GET \
--get "https://farmart.test/api/v1/categories/filters" \
--header "Authorization: Bearer {token}" \
--header "Api-Version: v1"
const url = new URL(
"https://farmart.test/api/v1/categories/filters"
);
const headers = {
"Authorization": "Bearer {token}",
"Api-Version": "v1",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
Example response (200):
Show headers
cache-control: no-cache, private
content-type: application/json
x-ratelimit-limit: 60
x-ratelimit-remaining: 53
access-control-allow-origin: *
{
"data": [
{
"id": 2,
"name": "Fashion",
"slug": "fashion",
"url": "https://farmart.test/blog/fashion",
"description": "Enim accusamus aut porro animi. Reprehenderit et vero perferendis earum quisquam quidem. Facere iste atque ipsum."
},
{
"id": 3,
"name": "Electronic",
"slug": "electronic",
"url": "https://farmart.test/blog/electronic",
"description": "Qui rerum ut impedit dolorem odio. Magnam non cupiditate et soluta placeat a id voluptatem. Dolores totam enim eveniet deserunt et architecto magnam."
},
{
"id": 1,
"name": "Ecommerce",
"slug": "ecommerce",
"url": "https://farmart.test/blog/ecommerce",
"description": "Qui dolores minus quia. Incidunt et et veniam sequi illum dolor. Quis rerum ullam harum ipsum voluptas eveniet."
},
{
"id": 4,
"name": "Commercial",
"slug": "commercial",
"url": "https://farmart.test/blog/commercial",
"description": "Porro quia ipsa quidem laborum dolor. Quia ut eum dolores. In debitis illo ut. Possimus dolores dicta vel quae."
}
],
"links": {
"first": "https://farmart.test/api/v1/categories/filters?page=1",
"last": "https://farmart.test/api/v1/categories/filters?page=1",
"prev": null,
"next": null
},
"meta": {
"current_page": 1,
"from": 1,
"last_page": 1,
"links": [
{
"url": null,
"label": "« Previous",
"active": false
},
{
"url": "https://farmart.test/api/v1/categories/filters?page=1",
"label": "1",
"active": true
},
{
"url": null,
"label": "Next »",
"active": false
}
],
"path": "https://farmart.test/api/v1/categories/filters",
"per_page": 10,
"to": 4,
"total": 4
},
"error": false,
"message": null
}
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 category by slug
Example request:
curl --request GET \
--get "https://farmart.test/api/v1/categories/sit?slug=quisquam" \
--header "Authorization: Bearer {token}" \
--header "Api-Version: v1"
const url = new URL(
"https://farmart.test/api/v1/categories/sit"
);
const params = {
"slug": "quisquam",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {token}",
"Api-Version": "v1",
"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: 60
x-ratelimit-remaining: 52
access-control-allow-origin: *
{
"error": true,
"data": null,
"message": "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.
Profile
Get the user profile information.
requires authentication
Example request:
curl --request GET \
--get "https://farmart.test/api/v1/me" \
--header "Authorization: Bearer {token}" \
--header "Api-Version: v1"
const url = new URL(
"https://farmart.test/api/v1/me"
);
const headers = {
"Authorization": "Bearer {token}",
"Api-Version": "v1",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
Example response (302):
Show headers
cache-control: no-cache, private
location: https://farmart.test/login
content-type: text/html; charset=UTF-8
access-control-allow-origin: *
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<meta http-equiv="refresh" content="0;url='https://farmart.test/login'" />
<title>Redirecting to https://farmart.test/login</title>
</head>
<body>
Redirecting to <a href="https://farmart.test/login">https://farmart.test/login</a>.
</body>
</html>
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 profile
requires authentication
Example request:
curl --request PUT \
"https://farmart.test/api/v1/me" \
--header "Authorization: Bearer {token}" \
--header "Api-Version: v1" \
--header "Content-Type: application/json" \
--data "{
\"first_name\": \"est\",
\"last_name\": \"voluptatibus\",
\"phone\": \"beatae\",
\"dob\": \"eligendi\",
\"gender\": \"culpa\",
\"description\": \"Quaerat illo et omnis perspiciatis.\",
\"email\": \"deckow.percy@example.org\"
}"
const url = new URL(
"https://farmart.test/api/v1/me"
);
const headers = {
"Authorization": "Bearer {token}",
"Api-Version": "v1",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"first_name": "est",
"last_name": "voluptatibus",
"phone": "beatae",
"dob": "eligendi",
"gender": "culpa",
"description": "Quaerat illo et omnis perspiciatis.",
"email": "deckow.percy@example.org"
};
fetch(url, {
method: "PUT",
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.
Update Avatar
requires authentication
Example request:
curl --request POST \
"https://farmart.test/api/v1/update/avatar" \
--header "Authorization: Bearer {token}" \
--header "Api-Version: v1" \
--header "Content-Type: multipart/form-data" \
--form "avatar=@/private/var/folders/h4/7j56n3vs11179mptv1t37ld40000gn/T/phpYSpuhe"
const url = new URL(
"https://farmart.test/api/v1/update/avatar"
);
const headers = {
"Authorization": "Bearer {token}",
"Api-Version": "v1",
"Content-Type": "multipart/form-data",
"Accept": "application/json",
};
const body = new FormData();
body.append('avatar', document.querySelector('input[name="avatar"]').files[0]);
fetch(url, {
method: "POST",
headers,
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.
Update password
requires authentication
Example request:
curl --request PUT \
"https://farmart.test/api/v1/update/password" \
--header "Authorization: Bearer {token}" \
--header "Api-Version: v1" \
--header "Content-Type: application/json" \
--data "{
\"password\": \"n`5;$T~I>;\"
}"
const url = new URL(
"https://farmart.test/api/v1/update/password"
);
const headers = {
"Authorization": "Bearer {token}",
"Api-Version": "v1",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"password": "n`5;$T~I>;"
};
fetch(url, {
method: "PUT",
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.