Weblutions Documentation
Weblutions Main Site Contact Us Our Discord
FaxStore IconFaxStore

Weblutions Documentation / FaxStore / Blogs API

Updated

Blogs API

By Josh M. 3 mins 31

The Blog API for FaxStore facilitates the management of blog content, including creating, deleting, updating, and retrieving blog posts. This API streamlines the process of maintaining and publishing content on your site.

Table of Contents


Get All Blogs

GET/api/blogs
Returns am array of all created blog posts.
Authorization
NameTypeRequiredDescription
authorizationStringrequired
Responses
200OKjson
View response body
[
  {
    "id": 3,
    "userId": "183355725132050432",
    "username": "John Doe",
    "title": "Why FaxStore is the best store!",
    "catId": 1,
    "image": "/image",
    "content": "MD content of the blog",
    "shortUrl": "dsd",
    "createdAt": "1723728274051",
    "edited": "1723728274051"
  },
  ...
]
404Not Foundplaintext
View response body
Blogs not found.

Get Blog

GET/api/blog/:id
Returns the blog associated with the ID provided.
Authorization
NameTypeRequiredDescription
authorizationStringrequired
Path parameters
NameTypeRequiredDescription
idStringrequiredA blog ID
Responses
200OKjson
View response body
{
  "id": 3,
  "userId": "183355725132050432",
  "username": "John Doe",
  "title": "Why FaxStore is the best store!",
  "catId": 1,
  "image": "/image",
  "content": "MD content of the blog",
  "shortUrl": "dsd",
  "createdAt": "1723728274051",
  "edited": "1723728274051"
}
404Not Foundjson
View response body
Blog ID not found.

Create Blog Post

POST/api/blog
Authorization
NameTypeRequiredDescription
authorizationStringrequired
Request body
NameTypeRequiredDescription
userIdStringrequiredA user ID to associate the post with.
usernameStringrequiredThe display name of the author.
titleStringrequiredThe blog post name.
urlStringrequiredThe URL identifier for the post.
catIdIntegeroptionalThe category ID to place the blog post within
contentStringrequiredThe body content of the blog post. Markdown is supported.
imageStringoptionalA complete image URL for a banner image.
Responses
200OKjson
View response body
{
  "id": 6,
  "userId": "61",
  "username": "Test User",
  "title": "Test Blog",
  "catId": 0,
  "image": "",
  "content": "test contyent **here!**",
  "shortUrl": "testbloggg",
  "createdAt": "1723777120536",
  "edited": null
}
400Bad Requestplaintext
View response body
Missing required body items - userId, username, title, and url are required.
404Not Foundplaintext
View response body
Blog ID not found after creation.

Delete Blog

DELETE/api/blog/:id
Authorization
NameTypeRequiredDescription
authorizationStringrequired
Path parameters
NameTypeRequiredDescription
idIntegerrequiredA blog post ID.
Responses
201OKplaintext
View response body
OK
404Not Foundjson
View response body
Blog ID not found.

Document History

Loading version history...