Publicly available API requests
For connecting the blog thing CMS tool to any project. First create your public API key in the project dashboard then continue to read the documentation page.
All request headers need to contain a custom header key blogthing-api-key with a value of your API key. We recommend saving that API key in a secret env file and in case you are using Next.js make sure to use server actions to fetch data as this will protect your api key, thus making blog-thing completely hidden.
Get public blogs
https://blogthing.starko.me/api/v1
This endpoint allows developers to retrieve a list of blogs.
Request Parameters
This endpoint does not require any request parameters. But it can include them, the full list of params can be found later in this documentation
Response Fields
In the event of a successful request, the response will contain a data object with the following...
Parameter | Type | Description |
---|---|---|
count | Integer | The total number of blogs |
blogs | Array | An array of blog objects |
Response Fields
In the event of a successful request, the response will contain a data object with the following...
Parameter | Type | Description |
---|---|---|
count | Integer | The total number of blogs |
blogs | Array | An array of blog objects |
_id | String | The unique identifier of the blog |
author | String | The author of the blog |
title | String | The title of the blog |
meta_title | String | The meta title of the blog |
slug | String | The slug of the blog |
summary | String | The summary of the blog |
project_id | String | The project ID of the blog |
published | Date | The publish date of the blog |
created_at | Date | The creation date of the blog |
updated_at | Date | The last updated date of the blog |
published_at | Date | The publish date of the blog |
blog_content | Text | HTML content of the blog |
thumbnail_id | String | The thumbnail ID of the blog |
user_id | String | The user ID of the blog |
public | Boolean | Indicates if the blog is public or not |
editor_data | JSON | The editor data of the blog |
lang | String | The language of the blog |
category_id | String | The category of the blog |
custom_field | JSON | User defined custom field |
thumbnailurl | String | The URL of the thumbnail image |
categoryname | String | The name of the category |
In the event of an error, the response will contain an error object with a message field describing the error.
Request headers
Must contain a header field **blogthing-api-key** Example : blogthing-api-key:b77b3aaf-e1ec-4969-9df7-be92d5d73fee We use axios in our testing but header tags can be easily changed in almost any different way of fetching data
Query Params
Query parameters allow you to customize your API requests for retrieving specific data from the server. Heres a list of available query parameters:
Parameter | Type | Description |
---|---|---|
simpleMode | Boolean | Default: false Setting simpleMode to true returns a simplified version of the response, suitable for listing all blogs. |
slug | String | Query by exact slug match. Use this parameter to retrieve a blog with a specific slug. |
lang | String | Query by exact language match. Specify the desired language (e.g., sr-RS ) to filter the results based on the language of the blogs. |
blog_id | String | Specify the blog_id to retrieve a specific blog with a unique ID. |
category_id | String | Specify the category_id to retrieve blogs within a particular category. |
limit | Integer | Default: 1 Set the limit parameter to control the number of results per page when paginating through the blog data. |
page | Integer | Default: 1 Set the page parameter to control the page number when paginating through the blog data. |
Documentation
Get categories
https://blogthing.starko.me/api/v1/categories
This endpoint allows developers to retrieve a list of categories from the blog.
Request Parameters
This endpoint does not require any request parameters.
Response Fields
In the event of a successful request, the response will contain a data array with the list of categories. Each category object will contain the following fields:
With a query param of lang you can filter the categories by language the default language is en
Parameter | Type | Description |
---|---|---|
_id | String | Unique identifier of the category |
name | String | Name of the category |
project_id | String | Unique identifier of the project the category belongs to |
public | Boolean | Indicates whether the category is public or not |
lang | String | Indicates the language of the category |
In the event of an error, the response will contain an error object with a message field describing the error.
Request Headers
Must contain a header field **blogthing-api-key** Example : blogthing-api-key:b77b3aaf-e1ec-5434-9df7-be92d5d73fee We use axios in our testing but header tags can be easily changed in almost any different way of fetching data