» Blog GET API Documentation

Getting All Blogs

Endpoint: GET /admin/blogs

Purpose

This API retrieves a list of blogs available for administrators. Administrators use the /admin/blogs endpoint to manage blog content, track publication status, and configure SEO settings. The API allows businesses to access blog details such as metadata, visibility, categories, and associated media. The response includes pagination, ensuring efficient retrieval of large blog lists.

Path Parameters

No path parameters for this endpoint.

Query Parameters

ParameterTypeDescription
limitIntegerNumber of Blogs per request.
offsetIntegerStarting point for pagination.
order_byStringField to sort results by.
directionStringSort order by ascending or descending.

Use Case

This API returns a list of blogs along with details such as blog ID, title, content, publication date, visibility, categories, and associated media. Each blog record includes metadata like SEO configurations and author details. The response also provides status information, such as whether a blog is published or in draft mode. Pagination details are included, specifying record limits, offsets, and links to navigate through large collections of blog posts. This endpoint is essential for administrators managing blog content, ensuring proper categorization, SEO optimization, and tracking of publication status.

Request Body

No data is required for the request body.

Response

GET
https://{your_site_domain}/api/v4/admin/blogs
Try It Out
{
    "blogs": [
        {
            "id": "BLOG_ID_1",
            "name": "BLOG_NAME_1",
            "url": "BLOG_URL_1",
            "content": "BLOG_CONTENT_1",
            "date": "BLOG_DATE_1",
            "is_published": "IS_PUBLISHED_1",
            "visibility": "VISIBILITY_1",
            "categories": [
                {
                    "id": "CATEGORY_ID_1",
                    "name": "CATEGORY_NAME_1",
                    "is_disposible": "IS_DISPOSIBLE_1",
                    "is_in_trash": "IS_IN_TRASH_1"
                }
            ],
            "created_at": "CREATED_AT_1",
            "is_disposible": "IS_DISPOSIBLE_1",
            "is_in_trash": "IS_IN_TRASH_1",
            "image": {
                "title": "IMAGE_TITLE_1",
                "alternative_text": "IMAGE_ALTERNATIVE_TEXT_1",
                "file_name": "FILE_NAME_1",
                "link": "IMAGE_LINK_1"
            },
            "created_by": {},
            "selected_customers": [],
            "seo_configs": [
                {
                    "id": "SEO_ID_1",
                    "value": "SEO_VALUE_1",
                    "type": "SEO_TYPE_1",
                    "config_key": "SEO_CONFIG_KEY_1"
                },
                {
                    "id": "SEO_ID_2",
                    "value": "SEO_VALUE_2",
                    "type": "SEO_TYPE_2",
                    "config_key": "SEO_CONFIG_KEY_2"
                }
            ]
        },
       
        {
            "id": "BLOG_ID_2",
            "name": "BLOG_NAME_2",
            "url": "BLOG_URL_2",
            "content": "BLOG_CONTENT_2",
            "date": "BLOG_DATE_2",
            "is_published": "IS_PUBLISHED_2",
            "visibility": "VISIBILITY_2",
            "categories": [],
            "created_at": "CREATED_AT_2",
            "is_disposible": "IS_DISPOSIBLE_2",
            "is_in_trash": "IS_IN_TRASH_2",
            "image": {
                "title": "IMAGE_TITLE_2",
                "alternative_text": "IMAGE_ALTERNATIVE_TEXT_2",
                "file_name": "FILE_NAME_2",
                "link": "IMAGE_LINK_2"
            },
            "created_by": {
                "id": "USER_ID_1",
                "name": "USER_NAME_1"
            },
            "selected_customers": {
                "customers": [
                    {
                        "id": "CUSTOMER_ID_1",
                        "name": "CUSTOMER_NAME_1"
                    },
                    {
                        "id": "CUSTOMER_ID_2",
                        "name": "CUSTOMER_NAME_2"
                    }
                ],
                "groups": [
                    {
                        "id": "GROUP_ID_1",
                        "name": "GROUP_NAME_1"
                    },
                    {
                        "id": "GROUP_ID_2",
                        "name": "GROUP_NAME_2"
                    }
                ]
            },
            "seo_configs": [
                {
                    "id": "SEO_ID_3",
                    "value": "SEO_VALUE_3",
                    "type": "SEO_TYPE_3",
                    "config_key": "SEO_CONFIG_KEY_3"
                },
                {
                    "id": "SEO_ID_4",
                    "value": "SEO_VALUE_4",
                    "type": "SEO_TYPE_4",
                    "config_key": "SEO_CONFIG_KEY_4"
                }
            ]
        }
    ],
    "pagination": {
        "records": "RECORDS_COUNT",
        "limit": "LIMIT_COUNT",
        "offset": "OFFSET_COUNT",
        "previous_page": "PREVIOUS_PAGE_URL",
        "next_page": "NEXT_PAGE_URL"
    }
}

Getting Specific Blog

Endpoint: GET /admin/blogs/{blog_id}

Purpose

This API retrieves the details of a specific blog post based on the given blog_id. It provides information such as the blog title, content, publication status, associated categories, SEO configurations, and visibility settings.

Path Parameters

ParameterTypeDescription
blog_idIntegerUnique identifier of the blog post

Query Parameters

No query parameters for this endpoint.

Use Case

This API is used when an administrator or system user needs to fetch detailed information about a specific blog post. It allows for retrieving the blog’s metadata, content, images, and visibility restrictions, helping administrators manage and review blog entries efficiently.

Request Body

No data is required for the request body.

Response

GET
https://{your_site_domain}/api/v4/admin/blogs/{blog_id}
Try It Out
{
    "blog": {
        "id": "BLOG_ID_10",
        "name": "BLOG_NAME_10",
        "url": "BLOG_URL_10",
        "content": "BLOG_CONTENT_10",
        "date": "BLOG_DATE_10",
        "is_published": "IS_PUBLISHED_10",
        "visibility": "VISIBILITY_10",
        "categories": "CATEGORIES_10",
        "created_at": "CREATED_AT_10",
        "is_disposible": "IS_DISPOSIBLE_10",
        "is_in_trash": "IS_IN_TRASH_10",
        "image": {
            "title": "IMAGE_TITLE_10",
            "alternative_text": "IMAGE_ALT_TEXT_10",
            "file_name": "IMAGE_FILE_NAME_10",
            "link": "IMAGE_LINK_10"
        },
        "created_by": {
            "id": "CREATED_BY_ID_10",
            "name": "CREATED_BY_NAME_10"
        },
        "selected_customers": {
            "customers": [
                {
                    "id": "CUSTOMER_ID_1",
                    "name": "CUSTOMER_NAME_1"
                },
                {
                    "id": "CUSTOMER_ID_2",
                    "name": "CUSTOMER_NAME_2"
                },
                {
                    "id": "CUSTOMER_ID_3",
                    "name": "CUSTOMER_NAME_3"
                }
            ],
            "groups": [
                {
                    "id": "GROUP_ID_1",
                    "name": "GROUP_NAME_1"
                },
                {
                    "id": "GROUP_ID_2",
                    "name": "GROUP_NAME_2"
                },
                {
                    "id": "GROUP_ID_3",
                    "name": "GROUP_NAME_3"
                },
                {
                    "id": "GROUP_ID_4",
                    "name": "GROUP_NAME_4"
                }
            ]
        },
        "seo_configs": [
            {
                "id": "SEO_ID_1021",
                "value": "SEO_VALUE_1",
                "type": "SEO_TYPE_1",
                "config_key": "SEO_CONFIG_KEY_1"
            },
            {
                "id": "SEO_ID_1024",
                "value": "SEO_VALUE_2",
                "type": "SEO_TYPE_2",
                "config_key": "SEO_CONFIG_KEY_2"
            },
            {
                "id": "SEO_ID_1027",
                "value": "SEO_VALUE_3",
                "type": "SEO_TYPE_3",
                "config_key": "SEO_CONFIG_KEY_3"
            },
            {
                "id": "SEO_ID_1030",
                "value": "SEO_VALUE_4",
                "type": "SEO_TYPE_4",
                "config_key": "SEO_CONFIG_KEY_4"
            }
        ]
    }
}

Getting Blog Count

Endpoint: GET /admin/blogs/count

Purpose

This API returns the total number of blogs available in the system. It helps administrators quickly determine the number of blogs present.

Path Parameters

No path parameters for this endpoint.

Query Parameters

No query parameters for this endpoint.

Use Case

This API is useful when an administrator or system needs to check the total number of blogs available, for example, to display blog counts in dashboards or reports.

Request Body

No data is required for the request body.

Response

GET
https://{your_site_domain}/api/v4/admin/blogs/count
Try It Out
{
    "count": "COUNT_VALUE"
}

Getting Blog Comments

Endpoint: GET /admin/blogs/{blog_id}/comments

Purpose

This API retrieves the list of comments associated with a specific blog post. It includes both top-level comments and their replies, allowing administrators to manage blog discussions effectively.

Path Parameters

ParameterTypeDescription
blog_idIntegerUnique identifier of the blog post

Query Parameters

No query parameters for this endpoint.

Use Case

This API is used when an administrator needs to review comments on a specific blog post. It returns all comments and their replies, along with details such as status, content, author information, and timestamps. This is useful for moderating comments, detecting spam, and managing user engagement.

Request Body

No data is required for the request body.

Response

GET
https://{your_site_domain}/api/v4/admin/blogs/{blog_id}/comments
Try It Out
{
    "id": "COMMENT_ID",
    "comments": [
        {
            "id": "COMMENT_ID_1",
            "status": "COMMENT_STATUS_1",
            "name": "COMMENT_NAME_1",
            "email": "<EMAIL_1>",
            "post_title": "POST_TITLE_1",
            "content": "COMMENT_CONTENT_1",
            "spam": "SPAM_STATUS_1",
            "likes": "LIKES_1",
            "total_reply": "TOTAL_REPLIES_1",
            "updated_at": "COMMENT_UPDATED_AT_1",
            "replies": [
                {
                    "id": "REPLY_ID_1",
                    "status": "REPLY_STATUS_1",
                    "name": "REPLY_NAME_1",
                    "email": "<REPLY_EMAIL_1>",
                    "post_title": "REPLY_POST_TITLE_1",
                    "content": "REPLY_CONTENT_1",
                    "spam": "REPLY_SPAM_STATUS_1",
                    "likes": "REPLY_LIKES_1",
                    "created_at": "REPLY_CREATED_AT_1",
                    "updated_at": "REPLY_UPDATED_AT_1"
                }
            ]
        }
    ]
}

Getting Specific Blog Comment

Endpoint: GET /admin/blogs/{blog_id}/comments/{comment_id}

Purpose

This API retrieves a specific comment on a blog post for administrators. Administrators use this endpoint to manage blog comments, track engagement, and moderate discussions. The response includes details about the comment, such as the commenter’s name, email, status, content, and any replies associated with the comment.

Path Parameters

ParameterTypeDescription
blog_idIntegerThe ID of the blog post.
comment_idIntegerThe ID of the specific comment.

Query Parameters

No query parameters for this endpoint.

Use Case

This API allows administrators to retrieve a specific comment on a blog post, along with its details such as commenter name, email, content, status, and engagement metrics like likes and replies. It helps in efficiently moderating blog discussions by reviewing the comment's approval status and identifying spam content. Additionally, the response includes all replies to the comment, allowing administrators to assess the conversation's context and track user interactions. The API ensures seamless comment management, enabling admins to maintain a structured and moderated discussion environment.

Request Body

No data is required for the request body.

Response

GET
https://{your_site_domain}/api/v4/admin/blogs/{blog_id}/comments/{comment_id}
Try It Out
{
    "id": "COMMENT_ID",
    "comment": {
        "id": "COMMENT_ID_1",
        "status": "COMMENT_STATUS_1",
        "name": "COMMENT_NAME_1",
        "email": "<EMAIL_1>",
        "post_title": "POST_TITLE_1",
        "content": "COMMENT_CONTENT_1",
        "spam": "SPAM_STATUS_1",
        "likes": "LIKES_1",
        "total_reply": "TOTAL_REPLIES_1",
        "updated_at": "COMMENT_UPDATED_AT_1",
        "replies": [
            {
                "id": "REPLY_ID_1",
                "status": "REPLY_STATUS_1",
                "name": "REPLY_NAME_1",
                "email": "<REPLY_EMAIL_1>",
                "post_title": "REPLY_POST_TITLE_1",
                "content": "REPLY_CONTENT_1",
                "spam": "REPLY_SPAM_STATUS_1",
                "likes": "REPLY_LIKES_1",
                "created_at": "REPLY_CREATED_AT_1",
                "updated_at": "REPLY_UPDATED_AT_1"
            }
        ]
    }
}

Getting Blog Categories

Endpoint: GET /admin/blog_categories

Path Parameters

No path parameters for this endpoint.

Query Parameters

ParameterTypeDescription
limitIntegerThe number of records to return per request.
offsetIntegerThe starting point for fetching records.
order_byStringField to sort results by.
directionStringSort order by ascending or descending.

Use Case

This endpoint is useful for administrators who need to fetch and manage blog categories efficiently. It allows filtering results with pagination, ensuring that a large number of categories can be retrieved in a structured manner. The response includes metadata such as SEO configurations and image details, which helps in optimizing blog visibility and content management.

Request Body

No data is required for the request body.

Response

GET
https://{your_site_domain}/api/v4/admin/blog_categories
Try It Out
{
    "blog_categories": [
        {
            "id": "CATEGORY_ID_1",
            "name": "CATEGORY_NAME_1",
            "url": "CATEGORY_URL_1",
            "description": "CATEGORY_DESCRIPTION_1",
            "is_disposible": "IS_DISPOSIBLE_1",
            "is_in_trash": "IS_IN_TRASH_1",
            "image": {
                "title": "IMAGE_TITLE_1",
                "alternative_text": "IMAGE_ALT_TEXT_1",
                "file_name": "IMAGE_FILE_NAME_1",
                "link": "IMAGE_LINK_1"
            },
            "created_at": "CATEGORY_CREATED_AT_1",
            "updated_at": "CATEGORY_UPDATED_AT_1",
            "seo_configs": [
                {
                    "id": "SEO_CONFIG_ID_1",
                    "value": "SEO_CONFIG_VALUE_1",
                    "type": "SEO_CONFIG_TYPE_1",
                    "config_key": "SEO_CONFIG_KEY_1"
                },
                {
                    "id": "SEO_CONFIG_ID_2",
                    "value": "SEO_CONFIG_VALUE_2",
                    "type": "SEO_CONFIG_TYPE_2",
                    "config_key": "SEO_CONFIG_KEY_2"
                },
                {
                    "id": "SEO_CONFIG_ID_3",
                    "value": "SEO_CONFIG_VALUE_3",
                    "type": "SEO_CONFIG_TYPE_3",
                    "config_key": "SEO_CONFIG_KEY_3"
                },
                {
                    "id": "SEO_CONFIG_ID_4",
                    "value": "SEO_CONFIG_VALUE_4",
                    "type": "SEO_CONFIG_TYPE_4",
                    "config_key": "SEO_CONFIG_KEY_4"
                },
                {
                    "id": "SEO_CONFIG_ID_5",
                    "value": "SEO_CONFIG_VALUE_5",
                    "type": "SEO_CONFIG_TYPE_5",
                    "config_key": "SEO_CONFIG_KEY_5"
                },
                {
                    "id": "SEO_CONFIG_ID_6",
                    "value": "SEO_CONFIG_VALUE_6",
                    "type": "SEO_CONFIG_TYPE_6",
                    "config_key": "SEO_CONFIG_KEY_6"
                },
                {
                    "id": "SEO_CONFIG_ID_7",
                    "value": "SEO_CONFIG_VALUE_7",
                    "type": "SEO_CONFIG_TYPE_7",
                    "config_key": "SEO_CONFIG_KEY_7"
                },
                {
                    "id": "SEO_CONFIG_ID_8",
                    "value": "SEO_CONFIG_VALUE_8",
                    "type": "SEO_CONFIG_TYPE_8",
                    "config_key": "SEO_CONFIG_KEY_8"
                },
                {
                    "id": "SEO_CONFIG_ID_9",
                    "value": "SEO_CONFIG_VALUE_9",
                    "type": "SEO_CONFIG_TYPE_9",
                    "config_key": "SEO_CONFIG_KEY_9"
                },
                {
                    "id": "SEO_CONFIG_ID_10",
                    "value": "SEO_CONFIG_VALUE_10",
                    "type": "SEO_CONFIG_TYPE_10",
                    "config_key": "SEO_CONFIG_KEY_10"
                }
            ]
        }
    ],
    "pagination": {
        "records": "TOTAL_RECORDS",
        "limit": "PAGE_LIMIT",
        "offset": "PAGE_OFFSET",
        "previous_page": "PREVIOUS_PAGE_URL",
        "next_page": "NEXT_PAGE_URL"
    }
}

Getting Specific Blog Category

Endpoint: GET /admin/blog_categories/{id}

Path Parameters

ParameterTypeDescription
idIntegerThe unique identifier of the blog category to retrieve.

Query Parameters

No query parameters for this endpoint.

Use Case

This endpoint is useful for fetching detailed information about a single blog category, including metadata, images, and SEO configurations. It can be used to display category details on a blog management dashboard or to programmatically access category-related data for further processing, such as analytics or content optimization.

Request Body

No data is required for the request body.

Response

GET
https://{your_site_domain}/api/v4/admin/blog_categories/{id}
Try It Out
{
    "blog_category": {
            "id": "CATEGORY_ID_1",
            "name": "CATEGORY_NAME_1",
            "url": "CATEGORY_URL_1",
            "description": "CATEGORY_DESCRIPTION_1",
            "is_disposible": "IS_DISPOSIBLE_1",
            "is_in_trash": "IS_IN_TRASH_1",
            "image": {
                "title": "IMAGE_TITLE_1",
                "alternative_text": "IMAGE_ALT_TEXT_1",
                "file_name": "IMAGE_FILE_NAME_1",
                "link": "IMAGE_LINK_1"
            },
            "created_at": "CATEGORY_CREATED_AT_1",
            "updated_at": "CATEGORY_UPDATED_AT_1",
            "seo_configs": [
                {
                    "id": "SEO_CONFIG_ID_1",
                    "value": "SEO_CONFIG_VALUE_1",
                    "type": "SEO_CONFIG_TYPE_1",
                    "config_key": "SEO_CONFIG_KEY_1"
                },
                {
                    "id": "SEO_CONFIG_ID_2",
                    "value": "SEO_CONFIG_VALUE_2",
                    "type": "SEO_CONFIG_TYPE_2",
                    "config_key": "SEO_CONFIG_KEY_2"
                },
                {
                    "id": "SEO_CONFIG_ID_3",
                    "value": "SEO_CONFIG_VALUE_3",
                    "type": "SEO_CONFIG_TYPE_3",
                    "config_key": "SEO_CONFIG_KEY_3"
                },
                {
                    "id": "SEO_CONFIG_ID_4",
                    "value": "SEO_CONFIG_VALUE_4",
                    "type": "SEO_CONFIG_TYPE_4",
                    "config_key": "SEO_CONFIG_KEY_4"
                },
                {
                    "id": "SEO_CONFIG_ID_5",
                    "value": "SEO_CONFIG_VALUE_5",
                    "type": "SEO_CONFIG_TYPE_5",
                    "config_key": "SEO_CONFIG_KEY_5"
                },
                {
                    "id": "SEO_CONFIG_ID_6",
                    "value": "SEO_CONFIG_VALUE_6",
                    "type": "SEO_CONFIG_TYPE_6",
                    "config_key": "SEO_CONFIG_KEY_6"
                },
                {
                    "id": "SEO_CONFIG_ID_7",
                    "value": "SEO_CONFIG_VALUE_7",
                    "type": "SEO_CONFIG_TYPE_7",
                    "config_key": "SEO_CONFIG_KEY_7"
                },
                {
                    "id": "SEO_CONFIG_ID_8",
                    "value": "SEO_CONFIG_VALUE_8",
                    "type": "SEO_CONFIG_TYPE_8",
                    "config_key": "SEO_CONFIG_KEY_8"
                },
                {
                    "id": "SEO_CONFIG_ID_9",
                    "value": "SEO_CONFIG_VALUE_9",
                    "type": "SEO_CONFIG_TYPE_9",
                    "config_key": "SEO_CONFIG_KEY_9"
                },
                {
                    "id": "SEO_CONFIG_ID_10",
                    "value": "SEO_CONFIG_VALUE_10",
                    "type": "SEO_CONFIG_TYPE_10",
                    "config_key": "SEO_CONFIG_KEY_10"
                }
            ]
        }
}