MENU navbar-image

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."
        ]
    }
}
 

Request      

POST api/v1/register

Headers

Authorization      

Example: Bearer {token}

Api-Version      

Example: v1

Content-Type      

Example: application/json

Body Parameters

first_name   string   

The name of the user. Example: cupiditate

last_name   string   

The name of the user. Example: voluptas

email   string   

The email of the user. Example: moen.daron@example.com

password   string   

The password of user to create. Example: |7>&WrhKQ

phone   string   

The phone of the user. Example: eaque

password_confirmation   string   

The password confirmation. Example: aliquam

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
}
 

Request      

POST api/v1/login

Headers

Authorization      

Example: Bearer {token}

Api-Version      

Example: v1

Content-Type      

Example: application/json

Body Parameters

email   string   

Must be a valid email address. Example: bswaniawski@example.net

password   string   

The password of user to create. Example: f_~7THR\OC|rM)

login   string   

The email/phone of the user. Example: esse

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());

Request      

POST api/v1/password/forgot

Headers

Authorization      

Example: Bearer {token}

Api-Version      

Example: v1

Content-Type      

Example: application/json

Body Parameters

email   string   

The email of the user. Example: rhiannon.windler@example.org

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());

Request      

POST api/v1/resend-verify-account-email

Headers

Authorization      

Example: Bearer {token}

Api-Version      

Example: v1

Content-Type      

Example: application/json

Body Parameters

email   string   

The email of the user. Example: marcelle.bergnaum@example.net

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>
 

Request      

GET api/v1/logout

Headers

Authorization      

Example: Bearer {token}

Api-Version      

Example: v1

Blog

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."
}
 

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": "&laquo; 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 &raquo;",
                "active": false
            }
        ],
        "path": "https://farmart.test/api/v1/posts",
        "per_page": 10,
        "to": 10,
        "total": 11
    },
    "error": false,
    "message": null
}
 

Request      

GET api/v1/posts

Headers

Authorization      

Example: Bearer {token}

Api-Version      

Example: v1

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": "&laquo; Previous",
                "active": false
            },
            {
                "url": "https://farmart.test/api/v1/categories?page=1",
                "label": "1",
                "active": true
            },
            {
                "url": null,
                "label": "Next &raquo;",
                "active": false
            }
        ],
        "path": "https://farmart.test/api/v1/categories",
        "per_page": 10,
        "to": 4,
        "total": 4
    },
    "error": false,
    "message": null
}
 

Request      

GET api/v1/categories

Headers

Authorization      

Example: Bearer {token}

Api-Version      

Example: v1

List tags

Example request:
curl --request GET \
    --get "https://farmart.test/api/v1/tags" \
    --header "Authorization: Bearer {token}" \
    --header "Api-Version: v1"
const url = new URL(
    "https://farmart.test/api/v1/tags"
);

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: 56
access-control-allow-origin: *
 

{
    "data": [
        {
            "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": ""
        }
    ],
    "links": {
        "first": "https://farmart.test/api/v1/tags?page=1",
        "last": "https://farmart.test/api/v1/tags?page=1",
        "prev": null,
        "next": null
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 1,
        "links": [
            {
                "url": null,
                "label": "&laquo; Previous",
                "active": false
            },
            {
                "url": "https://farmart.test/api/v1/tags?page=1",
                "label": "1",
                "active": true
            },
            {
                "url": null,
                "label": "Next &raquo;",
                "active": false
            }
        ],
        "path": "https://farmart.test/api/v1/tags",
        "per_page": 10,
        "to": 5,
        "total": 5
    },
    "error": false,
    "message": null
}
 

Request      

GET api/v1/tags

Headers

Authorization      

Example: Bearer {token}

Api-Version      

Example: v1

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": "&laquo; Previous",
                "active": false
            },
            {
                "url": "https://farmart.test/api/v1/posts/filters?page=1",
                "label": "1",
                "active": false
            },
            {
                "url": null,
                "label": "Next &raquo;",
                "active": false
            }
        ],
        "path": "https://farmart.test/api/v1/posts/filters",
        "per_page": 13,
        "to": null,
        "total": 0
    },
    "error": false,
    "message": null
}
 

Request      

GET api/v1/posts/filters

Headers

Authorization      

Example: Bearer {token}

Api-Version      

Example: v1

Query Parameters

page   integer  optional  

Current page of the collection. Default: 1 Example: 19

per_page   integer  optional  

Maximum number of items to be returned in result set.Default: 10 Example: 13

search   string  optional  

Limit results to those matching a string. Example: voluptatum

after   string  optional  

Limit response to posts published after a given ISO8601 compliant date. Example: amet

author   string  optional  

Limit result set to posts assigned to specific authors. Example: eveniet

author_exclude   string  optional  

Ensure result set excludes posts assigned to specific authors. Example: eius

before   string  optional  

Limit response to posts published before a given ISO8601 compliant date. Example: omnis

exclude   string  optional  

Ensure result set excludes specific IDs. Example: laudantium

include   string  optional  

Limit result set to specific IDs. Example: consequatur

order   string  optional  

Order sort attribute ascending or descending. Default: desc .One of: asc, desc Example: vero

order_by   string  optional  

Sort collection by object attribute. Default: updated_at. One of: author, created_at, updated_at, id, slug, title Example: magni

categories   string  optional  

Limit result set to all items that have the specified term assigned in the categories taxonomy. Example: quae

categories_exclude   string  optional  

Limit result set to all items except those that have the specified term assigned in the categories taxonomy. Example: est

tags   string  optional  

Limit result set to all items that have the specified term assigned in the tags taxonomy. Example: ab

tags_exclude   string  optional  

Limit result set to all items except those that have the specified term assigned in the tags taxonomy. Example: beatae

featured   string  optional  

Limit result set to items that are sticky. Example: consequatur

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"
}
 

Request      

GET api/v1/posts/{slug}

Headers

Authorization      

Example: Bearer {token}

Api-Version      

Example: v1

URL Parameters

slug   string   

The slug of the post. Example: aut

Query Parameters

slug   string  optional  

Find by slug of post. Example: dicta

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": "&laquo; Previous",
                "active": false
            },
            {
                "url": "https://farmart.test/api/v1/categories/filters?page=1",
                "label": "1",
                "active": true
            },
            {
                "url": null,
                "label": "Next &raquo;",
                "active": false
            }
        ],
        "path": "https://farmart.test/api/v1/categories/filters",
        "per_page": 10,
        "to": 4,
        "total": 4
    },
    "error": false,
    "message": null
}
 

Request      

GET api/v1/categories/filters

Headers

Authorization      

Example: Bearer {token}

Api-Version      

Example: v1

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"
}
 

Request      

GET api/v1/categories/{slug}

Headers

Authorization      

Example: Bearer {token}

Api-Version      

Example: v1

URL Parameters

slug   string   

The slug of the category. Example: sit

Query Parameters

slug   string  optional  

Find by slug of category. Example: quisquam

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>
 

Request      

GET api/v1/me

Headers

Authorization      

Example: Bearer {token}

Api-Version      

Example: v1

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());

Request      

PUT api/v1/me

Headers

Authorization      

Example: Bearer {token}

Api-Version      

Example: v1

Content-Type      

Example: application/json

Body Parameters

first_name   string   

First name. Example: est

last_name   string   

Last name. Example: voluptatibus

phone   string   

Phone. Example: beatae

dob   string   

Date of birth. Example: eligendi

gender   string  optional  

Gender Example: culpa

description   string  optional  

Description Example: Quaerat illo et omnis perspiciatis.

email   string  optional  

Email. Example: deckow.percy@example.org

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());

Request      

POST api/v1/update/avatar

Headers

Authorization      

Example: Bearer {token}

Api-Version      

Example: v1

Content-Type      

Example: multipart/form-data

Body Parameters

avatar   file   

Avatar file. Example: /private/var/folders/h4/7j56n3vs11179mptv1t37ld40000gn/T/phpYSpuhe

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());

Request      

PUT api/v1/update/password

Headers

Authorization      

Example: Bearer {token}

Api-Version      

Example: v1

Content-Type      

Example: application/json

Body Parameters

password   string   

The new password of user. Example: n5;$T~I>;`