Blog API: Documentation

(Developed with Golang)
hamburguer

What is an API?

An API is — in short — a set of dedicated URLs that return pure data responses, in most cases in JSON format — meaning the responses won’t contain the kind of presentational overhead that you would expect in a graphical user interface like a website. I took that great definition from this very understandable article. Please refer to it for more information!

Access the Blog API

You can access the API using the following base URL:

https://blog-api-production-2267.up.railway.app/

To interact with the blog API, append the specific endpoints listed above to the base URL.

How can I get my access token?

First, create an account by clicking on the menu in the top left corner and log in. Once you're logged in, you'll be able to access your profile and retrieve your access token.

Which routes are available?

MethodEndpointResponseToken Required
GET/postsGet all blog postsNo
Get/post/10Get a specific postYes - Regular user
Patch /posts/10Update a specific postYes - Admin only
POST/postCreate a new postYes - Admin only
Delete/delete/10Delete a specific postYes - Admin only

May I use pagination

Yes, you can add pagination, sorting and filtering options to your API requests.

Pagination

MethodExample
GET/posts?page=1&limit=10 (limit default is 10)
GET

1st page, 10 items: /posts?page=1&limit=10

2nd page, 10 items: /posts?page=2&limit=10

3rd page, 20 items: /posts?page=3&limit=20

Search

methodExamples
GET/search?query=javascript&category=all
GET/search?query=typescript&category=web
GET/search?query=react&category=mobile

How to Contribute to This Project

This project is open-source ❤️, I we’d love for you to help make it even better. Whether you're fixing bugs, adding features, or improving documentation, your input is always welcome. You can start by visiting the GitHub repository to explore the code and get involved.

Don't hesitate to fork the project, submit issues, and create pull requests. I can't wait to see what you'll bring to the project!

This API powers this blog: https://victorlirablog.com.br