Skip to content

Category

The Get All Categories API endpoint retrieves a list of available blog categories from the Blog CMS. This endpoint is publicly accessible, but requires a valid API key in the request headers. You can obtain your API key from the Settings → API Key page within your Blog CMS account. Use this POST API to:

  • Fetch categories for use in blog creation forms
  • Display category filters in your frontend interface
  • Retrieve custome and default categories by setting the default flag to true

1. cURL Example

curl --location 'https://api.jsonpress.in/api/v1/category/public/get-all',
--header 'x-api-key: YOUR_API_KEY',
--header 'Content-Type: application/json',
--data '{
"default": true
}'

2. Node.js (Axios) Example

const axios = require('axios');
let data = JSON.stringify({
"default": true
});
let config = {
method: 'post',
maxBodyLength: Infinity,
url: 'https://api.jsonpress.in/api/v1/category/public/get-all',
headers: {
'x-api-key': 'YOUR_API_KEY',
'Content-Type': 'application/json'
},
data : data
};
axios.request(config)
.then((response) => {
console.log(JSON.stringify(response.data));
})
.catch((error) => {
console.log(error);
});