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 \
"http://shofy.test/api/v1/register" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"first_name\": \"repudiandae\",
\"last_name\": \"sed\",
\"email\": \"aiden.stanton@example.org\",
\"password\": \"xnGXQjmJ-iXP\",
\"phone\": \"provident\",
\"password_confirmation\": \"ab\"
}"
const url = new URL(
"http://shofy.test/api/v1/register"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"first_name": "repudiandae",
"last_name": "sed",
"email": "aiden.stanton@example.org",
"password": "xnGXQjmJ-iXP",
"phone": "provident",
"password_confirmation": "ab"
};
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 \
"http://shofy.test/api/v1/login" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"email\": \"e.g: abc@example.com\",
\"password\": \"9$g^}56|w$r<j>9<q\",
\"login\": \"nulla\"
}"
const url = new URL(
"http://shofy.test/api/v1/login"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"email": "e.g: abc@example.com",
"password": "9$g^}56|w$r<j>9<q",
"login": "nulla"
};
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 \
"http://shofy.test/api/v1/password/forgot" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"email\": \"angelo94@example.net\"
}"
const url = new URL(
"http://shofy.test/api/v1/password/forgot"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"email": "angelo94@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.
Resend email verification
Resend the email verification notification.
Example request:
curl --request POST \
"http://shofy.test/api/v1/resend-verify-account-email" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"email\": \"chadrick36@example.org\"
}"
const url = new URL(
"http://shofy.test/api/v1/resend-verify-account-email"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"email": "chadrick36@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.
Logout
requires authentication
Example request:
curl --request GET \
--get "http://shofy.test/api/v1/logout" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
const url = new URL(
"http://shofy.test/api/v1/logout"
);
const headers = {
"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: *
{
"error": true,
"data": null,
"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.
Blog
Search post
Example request:
curl --request GET \
--get "http://shofy.test/api/v1/search" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"q\": \"veniam\"
}"
const url = new URL(
"http://shofy.test/api/v1/search"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"q": "veniam"
};
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: 51
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 "http://shofy.test/api/v1/posts" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
const url = new URL(
"http://shofy.test/api/v1/posts"
);
const headers = {
"Content-Type": "application/json",
"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: 50
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": "Alice, with a shiver. 'I beg your pardon,' said Alice indignantly, and she hastily dried her eyes immediately met those of a muchness\"--did you ever saw. How she longed to change the subject. 'Go on.",
"image": "http://shofy.test/storage/main/blog/post-7.jpg",
"categories": [
{
"id": 2,
"name": "Fashion",
"slug": "fashion",
"url": "http://shofy.test/blog/fashion",
"description": "Blanditiis enim et sequi necessitatibus maxime mollitia fugiat doloremque. Est soluta dolores et in ab dolores. Et porro dolor rerum tempore inventore quia dolor."
},
{
"id": 4,
"name": "Commercial",
"slug": "commercial",
"url": "http://shofy.test/blog/commercial",
"description": "Quas in id sit. Dolorem provident minima modi dolor est."
}
],
"tags": [
{
"id": 1,
"name": "General",
"slug": "general",
"description": ""
},
{
"id": 3,
"name": "Fashion",
"slug": "fashion",
"description": ""
},
{
"id": 8,
"name": "Sunglasses",
"slug": "sunglasses",
"description": ""
}
],
"created_at": "2024-04-11T08:14:30.000000Z",
"updated_at": "2024-04-11T08:14:30.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": "Queen of Hearts, carrying the King's crown on a little timidly, for she felt that it was growing, and she jumped up and saying, 'Thank you, sir, for your walk!\" \"Coming in a minute or two, it was.",
"image": "http://shofy.test/storage/main/blog/post-9.jpg",
"categories": [
{
"id": 2,
"name": "Fashion",
"slug": "fashion",
"url": "http://shofy.test/blog/fashion",
"description": "Blanditiis enim et sequi necessitatibus maxime mollitia fugiat doloremque. Est soluta dolores et in ab dolores. Et porro dolor rerum tempore inventore quia dolor."
},
{
"id": 5,
"name": "Organic Fruits",
"slug": "organic-fruits",
"url": "http://shofy.test/blog/organic-fruits",
"description": "Quia aliquam quisquam est beatae vel. Optio non possimus odit animi. Laborum nihil laudantium quia sunt officia."
}
],
"tags": [
{
"id": 2,
"name": "Design",
"slug": "design",
"description": ""
},
{
"id": 6,
"name": "Nature",
"slug": "nature",
"description": ""
}
],
"created_at": "2024-04-11T08:14:30.000000Z",
"updated_at": "2024-04-11T08:14:30.000000Z"
},
{
"id": 3,
"name": "The Top 2020 Handbag Trends to Know",
"slug": "the-top-2020-handbag-trends-to-know",
"description": "Queen. 'Well, I shan't go, at any rate he might answer questions.--How am I to get rather sleepy, and went by without noticing her. Then followed the Knave 'Turn them over!' The Knave did so, very.",
"image": "http://shofy.test/storage/main/blog/post-4.jpg",
"categories": [
{
"id": 2,
"name": "Fashion",
"slug": "fashion",
"url": "http://shofy.test/blog/fashion",
"description": "Blanditiis enim et sequi necessitatibus maxime mollitia fugiat doloremque. Est soluta dolores et in ab dolores. Et porro dolor rerum tempore inventore quia dolor."
},
{
"id": 5,
"name": "Organic Fruits",
"slug": "organic-fruits",
"url": "http://shofy.test/blog/organic-fruits",
"description": "Quia aliquam quisquam est beatae vel. Optio non possimus odit animi. Laborum nihil laudantium quia sunt officia."
}
],
"tags": [
{
"id": 5,
"name": "Modern",
"slug": "modern",
"description": ""
},
{
"id": 7,
"name": "Vintage",
"slug": "vintage",
"description": ""
}
],
"created_at": "2024-04-11T08:14:30.000000Z",
"updated_at": "2024-04-11T08:14:30.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": "I to do?' said Alice. The King looked anxiously round, to make out which were the two sides of it, and on both sides at once. The Dormouse had closed its eyes again, to see what I was a good deal.",
"image": "http://shofy.test/storage/main/blog/post-3.jpg",
"categories": [
{
"id": 3,
"name": "Electronic",
"slug": "electronic",
"url": "http://shofy.test/blog/electronic",
"description": "Quis qui aspernatur in quia hic eum. Est molestias assumenda nam iusto optio voluptatem et. Repudiandae dolores quibusdam ut adipisci. Molestiae sequi reprehenderit mollitia cum non."
},
{
"id": 4,
"name": "Commercial",
"slug": "commercial",
"url": "http://shofy.test/blog/commercial",
"description": "Quas in id sit. Dolorem provident minima modi dolor est."
}
],
"tags": [
{
"id": 3,
"name": "Fashion",
"slug": "fashion",
"description": ""
},
{
"id": 7,
"name": "Vintage",
"slug": "vintage",
"description": ""
},
{
"id": 8,
"name": "Sunglasses",
"slug": "sunglasses",
"description": ""
}
],
"created_at": "2024-04-11T08:14:30.000000Z",
"updated_at": "2024-04-11T08:14:30.000000Z"
},
{
"id": 5,
"name": "How to Care for Leather Bags",
"slug": "how-to-care-for-leather-bags",
"description": "Quick, now!' And Alice was just going to begin with; and being so many lessons to learn! No, I've made up my mind about it; and while she remembered trying to make out what it was: at first was in.",
"image": "http://shofy.test/storage/main/blog/post-7.jpg",
"categories": [
{
"id": 4,
"name": "Commercial",
"slug": "commercial",
"url": "http://shofy.test/blog/commercial",
"description": "Quas in id sit. Dolorem provident minima modi dolor est."
},
{
"id": 5,
"name": "Organic Fruits",
"slug": "organic-fruits",
"url": "http://shofy.test/blog/organic-fruits",
"description": "Quia aliquam quisquam est beatae vel. Optio non possimus odit animi. Laborum nihil laudantium quia sunt officia."
}
],
"tags": [
{
"id": 2,
"name": "Design",
"slug": "design",
"description": ""
},
{
"id": 5,
"name": "Modern",
"slug": "modern",
"description": ""
},
{
"id": 6,
"name": "Nature",
"slug": "nature",
"description": ""
}
],
"created_at": "2024-04-11T08:14:30.000000Z",
"updated_at": "2024-04-11T08:14:30.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": "Alice whispered, 'that it's done by everybody minding their own business!' 'Ah, well! It means much the same thing with you,' said Alice, seriously, 'I'll have nothing more to do with you. Mind.",
"image": "http://shofy.test/storage/main/blog/post-9.jpg",
"categories": [
{
"id": 6,
"name": "Ecological",
"slug": "ecological",
"url": "http://shofy.test/blog/ecological",
"description": "Ut blanditiis incidunt adipisci numquam vel repellat consequuntur. Aut nostrum molestiae non. Omnis ut quisquam dignissimos esse. Consequuntur aliquam et et repellendus esse."
}
],
"tags": [
{
"id": 2,
"name": "Design",
"slug": "design",
"description": ""
},
{
"id": 7,
"name": "Vintage",
"slug": "vintage",
"description": ""
}
],
"created_at": "2024-04-11T08:14:30.000000Z",
"updated_at": "2024-04-11T08:14:30.000000Z"
},
{
"id": 7,
"name": "Essential Qualities of Highly Successful Music",
"slug": "essential-qualities-of-highly-successful-music",
"description": "Queen, who had been for some time without hearing anything more: at last it unfolded its arms, took the hookah into its eyes by this time?' she said to herself how this same little sister of hers.",
"image": "http://shofy.test/storage/main/blog/post-7.jpg",
"categories": [
{
"id": 1,
"name": "Crisp Bread & Cake",
"slug": "crisp-bread-cake",
"url": "http://shofy.test/blog/crisp-bread-cake",
"description": "Nemo et sit consequuntur animi quae ab. Aut quo voluptas quas. Ab aliquam deleniti sunt consequatur dicta id."
},
{
"id": 6,
"name": "Ecological",
"slug": "ecological",
"url": "http://shofy.test/blog/ecological",
"description": "Ut blanditiis incidunt adipisci numquam vel repellat consequuntur. Aut nostrum molestiae non. Omnis ut quisquam dignissimos esse. Consequuntur aliquam et et repellendus esse."
}
],
"tags": [
{
"id": 1,
"name": "General",
"slug": "general",
"description": ""
},
{
"id": 7,
"name": "Vintage",
"slug": "vintage",
"description": ""
},
{
"id": 8,
"name": "Sunglasses",
"slug": "sunglasses",
"description": ""
}
],
"created_at": "2024-04-11T08:14:30.000000Z",
"updated_at": "2024-04-11T08:14:30.000000Z"
},
{
"id": 8,
"name": "9 Things I Love About Shaving My Head",
"slug": "9-things-i-love-about-shaving-my-head",
"description": "Said the mouse doesn't get out.\" Only I don't know,' he went on so long since she had wept when she got up this morning, but I shall have somebody to talk to.' 'How are you thinking of?' 'I beg your.",
"image": "http://shofy.test/storage/main/blog/post-7.jpg",
"categories": [
{
"id": 1,
"name": "Crisp Bread & Cake",
"slug": "crisp-bread-cake",
"url": "http://shofy.test/blog/crisp-bread-cake",
"description": "Nemo et sit consequuntur animi quae ab. Aut quo voluptas quas. Ab aliquam deleniti sunt consequatur dicta id."
},
{
"id": 5,
"name": "Organic Fruits",
"slug": "organic-fruits",
"url": "http://shofy.test/blog/organic-fruits",
"description": "Quia aliquam quisquam est beatae vel. Optio non possimus odit animi. Laborum nihil laudantium quia sunt officia."
}
],
"tags": [
{
"id": 5,
"name": "Modern",
"slug": "modern",
"description": ""
},
{
"id": 6,
"name": "Nature",
"slug": "nature",
"description": ""
}
],
"created_at": "2024-04-11T08:14:30.000000Z",
"updated_at": "2024-04-11T08:14:30.000000Z"
},
{
"id": 9,
"name": "Why Teamwork Really Makes The Dream Work",
"slug": "why-teamwork-really-makes-the-dream-work",
"description": "Cat's head began fading away the moment he was in confusion, getting the Dormouse said--' the Hatter went on, '\"--found it advisable to go on crying in this way! Stop this moment, and fetch me a.",
"image": "http://shofy.test/storage/main/blog/post-1.jpg",
"categories": [
{
"id": 1,
"name": "Crisp Bread & Cake",
"slug": "crisp-bread-cake",
"url": "http://shofy.test/blog/crisp-bread-cake",
"description": "Nemo et sit consequuntur animi quae ab. Aut quo voluptas quas. Ab aliquam deleniti sunt consequatur dicta id."
},
{
"id": 5,
"name": "Organic Fruits",
"slug": "organic-fruits",
"url": "http://shofy.test/blog/organic-fruits",
"description": "Quia aliquam quisquam est beatae vel. Optio non possimus odit animi. Laborum nihil laudantium quia sunt officia."
}
],
"tags": [
{
"id": 3,
"name": "Fashion",
"slug": "fashion",
"description": ""
},
{
"id": 5,
"name": "Modern",
"slug": "modern",
"description": ""
},
{
"id": 6,
"name": "Nature",
"slug": "nature",
"description": ""
}
],
"created_at": "2024-04-11T08:14:30.000000Z",
"updated_at": "2024-04-11T08:14:30.000000Z"
},
{
"id": 10,
"name": "The World Caters to Average People",
"slug": "the-world-caters-to-average-people",
"description": "Alice, every now and then raised himself upon tiptoe, put his mouth close to her: its face to see what the flame of a tree. By the use of this rope--Will the roof bear?--Mind that loose slate--Oh.",
"image": "http://shofy.test/storage/main/blog/post-10.jpg",
"categories": [
{
"id": 2,
"name": "Fashion",
"slug": "fashion",
"url": "http://shofy.test/blog/fashion",
"description": "Blanditiis enim et sequi necessitatibus maxime mollitia fugiat doloremque. Est soluta dolores et in ab dolores. Et porro dolor rerum tempore inventore quia dolor."
},
{
"id": 4,
"name": "Commercial",
"slug": "commercial",
"url": "http://shofy.test/blog/commercial",
"description": "Quas in id sit. Dolorem provident minima modi dolor est."
}
],
"tags": [
{
"id": 2,
"name": "Design",
"slug": "design",
"description": ""
},
{
"id": 3,
"name": "Fashion",
"slug": "fashion",
"description": ""
},
{
"id": 6,
"name": "Nature",
"slug": "nature",
"description": ""
}
],
"created_at": "2024-04-11T08:14:30.000000Z",
"updated_at": "2024-04-11T08:14:30.000000Z"
}
],
"links": {
"first": "http://shofy.test/api/v1/posts?page=1",
"last": "http://shofy.test/api/v1/posts?page=2",
"prev": null,
"next": "http://shofy.test/api/v1/posts?page=2"
},
"meta": {
"current_page": 1,
"from": 1,
"last_page": 2,
"links": [
{
"url": null,
"label": "« Previous",
"active": false
},
{
"url": "http://shofy.test/api/v1/posts?page=1",
"label": "1",
"active": true
},
{
"url": "http://shofy.test/api/v1/posts?page=2",
"label": "2",
"active": false
},
{
"url": "http://shofy.test/api/v1/posts?page=2",
"label": "Next »",
"active": false
}
],
"path": "http://shofy.test/api/v1/posts",
"per_page": 10,
"to": 10,
"total": 18
},
"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 "http://shofy.test/api/v1/categories" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
const url = new URL(
"http://shofy.test/api/v1/categories"
);
const headers = {
"Content-Type": "application/json",
"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: 49
access-control-allow-origin: *
{
"data": [
{
"id": 6,
"name": "Ecological",
"slug": "ecological",
"description": "Ut blanditiis incidunt adipisci numquam vel repellat consequuntur. Aut nostrum molestiae non. Omnis ut quisquam dignissimos esse. Consequuntur aliquam et et repellendus esse.",
"children": [],
"parent": {
"id": null,
"name": "",
"slug": "",
"url": "http://shofy.test",
"description": ""
}
},
{
"id": 5,
"name": "Organic Fruits",
"slug": "organic-fruits",
"description": "Quia aliquam quisquam est beatae vel. Optio non possimus odit animi. Laborum nihil laudantium quia sunt officia.",
"children": [],
"parent": {
"id": null,
"name": "",
"slug": "",
"url": "http://shofy.test",
"description": ""
}
},
{
"id": 4,
"name": "Commercial",
"slug": "commercial",
"description": "Quas in id sit. Dolorem provident minima modi dolor est.",
"children": [],
"parent": {
"id": null,
"name": "",
"slug": "",
"url": "http://shofy.test",
"description": ""
}
},
{
"id": 3,
"name": "Electronic",
"slug": "electronic",
"description": "Quis qui aspernatur in quia hic eum. Est molestias assumenda nam iusto optio voluptatem et. Repudiandae dolores quibusdam ut adipisci. Molestiae sequi reprehenderit mollitia cum non.",
"children": [],
"parent": {
"id": null,
"name": "",
"slug": "",
"url": "http://shofy.test",
"description": ""
}
},
{
"id": 2,
"name": "Fashion",
"slug": "fashion",
"description": "Blanditiis enim et sequi necessitatibus maxime mollitia fugiat doloremque. Est soluta dolores et in ab dolores. Et porro dolor rerum tempore inventore quia dolor.",
"children": [],
"parent": {
"id": null,
"name": "",
"slug": "",
"url": "http://shofy.test",
"description": ""
}
},
{
"id": 1,
"name": "Crisp Bread & Cake",
"slug": "crisp-bread-cake",
"description": "Nemo et sit consequuntur animi quae ab. Aut quo voluptas quas. Ab aliquam deleniti sunt consequatur dicta id.",
"children": [],
"parent": {
"id": null,
"name": "",
"slug": "",
"url": "http://shofy.test",
"description": ""
}
}
],
"links": {
"first": "http://shofy.test/api/v1/categories?page=1",
"last": "http://shofy.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": "http://shofy.test/api/v1/categories?page=1",
"label": "1",
"active": true
},
{
"url": null,
"label": "Next »",
"active": false
}
],
"path": "http://shofy.test/api/v1/categories",
"per_page": 10,
"to": 6,
"total": 6
},
"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 "http://shofy.test/api/v1/posts/filters?page=15&per_page=17&search=laboriosam&after=rerum&author=aut&author_exclude=quo&before=soluta&exclude=minima&include=vero&order=magnam&order_by=aliquam&categories=non&categories_exclude=aperiam&tags=ut&tags_exclude=odit&featured=fuga" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
const url = new URL(
"http://shofy.test/api/v1/posts/filters"
);
const params = {
"page": "15",
"per_page": "17",
"search": "laboriosam",
"after": "rerum",
"author": "aut",
"author_exclude": "quo",
"before": "soluta",
"exclude": "minima",
"include": "vero",
"order": "magnam",
"order_by": "aliquam",
"categories": "non",
"categories_exclude": "aperiam",
"tags": "ut",
"tags_exclude": "odit",
"featured": "fuga",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Content-Type": "application/json",
"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: 47
access-control-allow-origin: *
{
"data": [],
"links": {
"first": "http://shofy.test/api/v1/posts/filters?page=1",
"last": "http://shofy.test/api/v1/posts/filters?page=1",
"prev": "http://shofy.test/api/v1/posts/filters?page=14",
"next": null
},
"meta": {
"current_page": 15,
"from": null,
"last_page": 1,
"links": [
{
"url": "http://shofy.test/api/v1/posts/filters?page=14",
"label": "« Previous",
"active": false
},
{
"url": "http://shofy.test/api/v1/posts/filters?page=1",
"label": "1",
"active": false
},
{
"url": null,
"label": "Next »",
"active": false
}
],
"path": "http://shofy.test/api/v1/posts/filters",
"per_page": 17,
"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 "http://shofy.test/api/v1/posts/voluptatem?slug=dicta" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
const url = new URL(
"http://shofy.test/api/v1/posts/voluptatem"
);
const params = {
"slug": "dicta",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"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: 60
x-ratelimit-remaining: 46
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 "http://shofy.test/api/v1/categories/filters" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
const url = new URL(
"http://shofy.test/api/v1/categories/filters"
);
const headers = {
"Content-Type": "application/json",
"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: 45
access-control-allow-origin: *
{
"data": [
{
"id": 5,
"name": "Organic Fruits",
"slug": "organic-fruits",
"url": "http://shofy.test/blog/organic-fruits",
"description": "Quia aliquam quisquam est beatae vel. Optio non possimus odit animi. Laborum nihil laudantium quia sunt officia."
},
{
"id": 2,
"name": "Fashion",
"slug": "fashion",
"url": "http://shofy.test/blog/fashion",
"description": "Blanditiis enim et sequi necessitatibus maxime mollitia fugiat doloremque. Est soluta dolores et in ab dolores. Et porro dolor rerum tempore inventore quia dolor."
},
{
"id": 3,
"name": "Electronic",
"slug": "electronic",
"url": "http://shofy.test/blog/electronic",
"description": "Quis qui aspernatur in quia hic eum. Est molestias assumenda nam iusto optio voluptatem et. Repudiandae dolores quibusdam ut adipisci. Molestiae sequi reprehenderit mollitia cum non."
},
{
"id": 6,
"name": "Ecological",
"slug": "ecological",
"url": "http://shofy.test/blog/ecological",
"description": "Ut blanditiis incidunt adipisci numquam vel repellat consequuntur. Aut nostrum molestiae non. Omnis ut quisquam dignissimos esse. Consequuntur aliquam et et repellendus esse."
},
{
"id": 1,
"name": "Crisp Bread & Cake",
"slug": "crisp-bread-cake",
"url": "http://shofy.test/blog/crisp-bread-cake",
"description": "Nemo et sit consequuntur animi quae ab. Aut quo voluptas quas. Ab aliquam deleniti sunt consequatur dicta id."
},
{
"id": 4,
"name": "Commercial",
"slug": "commercial",
"url": "http://shofy.test/blog/commercial",
"description": "Quas in id sit. Dolorem provident minima modi dolor est."
}
],
"links": {
"first": "http://shofy.test/api/v1/categories/filters?page=1",
"last": "http://shofy.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": "http://shofy.test/api/v1/categories/filters?page=1",
"label": "1",
"active": true
},
{
"url": null,
"label": "Next »",
"active": false
}
],
"path": "http://shofy.test/api/v1/categories/filters",
"per_page": 10,
"to": 6,
"total": 6
},
"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 "http://shofy.test/api/v1/categories/reiciendis?slug=nesciunt" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
const url = new URL(
"http://shofy.test/api/v1/categories/reiciendis"
);
const params = {
"slug": "nesciunt",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"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: 60
x-ratelimit-remaining: 44
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 "http://shofy.test/api/v1/me" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
const url = new URL(
"http://shofy.test/api/v1/me"
);
const headers = {
"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: *
{
"error": true,
"data": null,
"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.
Update profile
requires authentication
Example request:
curl --request PUT \
"http://shofy.test/api/v1/me" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"first_name\": \"et\",
\"last_name\": \"delectus\",
\"phone\": \"ad\",
\"dob\": \"facere\",
\"gender\": \"at\",
\"description\": \"Expedita eveniet aliquam ducimus ab itaque.\",
\"email\": \"willms.asia@example.net\"
}"
const url = new URL(
"http://shofy.test/api/v1/me"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"first_name": "et",
"last_name": "delectus",
"phone": "ad",
"dob": "facere",
"gender": "at",
"description": "Expedita eveniet aliquam ducimus ab itaque.",
"email": "willms.asia@example.net"
};
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 \
"http://shofy.test/api/v1/update/avatar" \
--header "Content-Type: multipart/form-data" \
--header "Accept: application/json" \
--form "avatar=@/private/var/folders/h4/7j56n3vs11179mptv1t37ld40000gn/T/phpha67zy"
const url = new URL(
"http://shofy.test/api/v1/update/avatar"
);
const headers = {
"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 \
"http://shofy.test/api/v1/update/password" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"password\": \"\\\\$IfQ]*C[Gj\\\"\"
}"
const url = new URL(
"http://shofy.test/api/v1/update/password"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"password": "\\$IfQ]*C[Gj\""
};
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.