BlogHouse API

This page will guide you through everything you need to know about our api!

Authorization

To get started with our api, you first need to get your api key.

  1. 1. Go to your dashboard
  2. 2. Copy your api key
screenshot

👇

screenshot

Note: You should never share your api key with anyone!

Usage

It's quite simple to you our api, here's an example:

                
            fetch('https://bloghouse.cf/api/users', {
                method: "GET",
                headers: {
                    authorization: "your-api-key"
                }
            }).then(res => res.json())
            .then(data => console.log(data))
                
            

Endpoints

As of now, our api has 5 main endpoints:

Method: GET /api/users

IF status code is 200

Returns: Array with objects

Example result:

[ { "uid": "53062997918043", "avatar": "http://res.cloudinary.com/decc00n/image/upload/v1624392018/decc00n-avatar.png", "isBanned": false, "isAdmin": true, "bio": "In love with BlogHouse!", "followers": ["41000280873374","71793775"], "following": ["41000280873374","71793775"], "posRep": 1, "negRep": 0, "name": "decc00n", "registeredAt": "2021-05-07T17:23:59.765Z", "slug": "decc00n" }, ... ]

Method: GET /api/users/{user-slug}

IF status code is 200

Returns: Object

Example result:

{ "uid": "53062997918043", "avatar": "http://res.cloudinary.com/decc00n/image/upload/v1624392018/decc00n-avatar.png", "isBanned": false, "isAdmin": true, "bio": "In love with BlogHouse!", "followers": ["41000280873374","71793775"], "following": ["41000280873374","71793775"], "posRep": 1, "negRep": 0, "name": "decc00n", "registeredAt": "2021-05-07T17:23:59.765Z", "slug": "decc00n" }

Method: GET /api/users/{user-slug}/posts

IF status code is 200

Returns: Array with objects

Example result:

[ { "views": 12, "seenBy": ["53062997918043"], "createdAt": "2021-05-07T17:32:30.251Z", "title": "COVID-19: Unpleasing news", "description": "COVID-19 is getting stronger and harder to defeat, even with the vaccine", "markdown": "## No one can deny that 2020 has been a terrible year, when COVID-19 was discovered we were all in shock, we were forced to stay in our houses terrified of going outside, hoping to find a solution for this crisis.\r\n### But then even after discovering the vaccine, we're still afraid, its getting stronger and stronger with each transformation it occures.", "author": "53062997918043", "slug": "covid-19-unpleasing-news", "sanitizedHTML": "

No one can deny that 2020 has been a terrible year, when COVID-19 was discovered we were all in shock, we were forced to stay in our houses terrified of going outside, hoping to find a solution for this crisis.

\n

But then even after discovering the vaccine, we're still afraid, its getting stronger and stronger with each transformation it occures.

\n" } ]

Method: GET /api/posts

IF status code is 200

Returns: Array with objects

Example result:

[ { "views": 12, "seenBy": ["53062997918043"], "createdAt": "2021-05-07T17:32:30.251Z", "title": "COVID-19: Unpleasing news", "description": "COVID-19 is getting stronger and harder to defeat, even with the vaccine", "markdown": "## No one can deny that 2020 has been a terrible year, when COVID-19 was discovered we were all in shock, we were forced to stay in our houses terrified of going outside, hoping to find a solution for this crisis.\r\n### But then even after discovering the vaccine, we're still afraid, its getting stronger and stronger with each transformation it occures.", "author": "53062997918043", "slug": "covid-19-unpleasing-news", "sanitizedHTML": "

No one can deny that 2020 has been a terrible year, when COVID-19 was discovered we were all in shock, we were forced to stay in our houses terrified of going outside, hoping to find a solution for this crisis.

\n

But then even after discovering the vaccine, we're still afraid, its getting stronger and stronger with each transformation it occures.

\n" }, ... ]

Method: GET /api/posts/{post-slug}

IF status code is 200

Returns: Object

Example result:

{ "views": 12, "seenBy": ["53062997918043"], "createdAt": "2021-05-07T17:32:30.251Z", "title": "COVID-19: Unpleasing news", "description": "COVID-19 is getting stronger and harder to defeat, even with the vaccine", "markdown": "## No one can deny that 2020 has been a terrible year, when COVID-19 was discovered we were all in shock, we were forced to stay in our houses terrified of going outside, hoping to find a solution for this crisis.\r\n### But then even after discovering the vaccine, we're still afraid, its getting stronger and stronger with each transformation it occures.", "author": "53062997918043", "slug": "covid-19-unpleasing-news", "sanitizedHTML": "

No one can deny that 2020 has been a terrible year, when COVID-19 was discovered we were all in shock, we were forced to stay in our houses terrified of going outside, hoping to find a solution for this crisis.

\n

But then even after discovering the vaccine, we're still afraid, its getting stronger and stronger with each transformation it occures.

\n" }