Creating Blogs
Endpoint: POST /admin/blogs
Purpose
This API allows administrators to create a new blog post within the system. It enables them to define the blog's title, content, categories, tags, visibility settings, SEO configurations, and customer access restrictions. Additionally, admins can upload an image for the blog and manage tracking settings for analytics and marketing purposes.
Path Parameters
No path parameters for this endpoint.
Query Parameters
No query parameters for this endpoint.
Use Case
An administrator wants to publish a new blog post on the platform, complete with content, an associated image, categories, and SEO configurations. The API allows the admin to specify the post's visibility, decide whether it should be indexed by search engines, and configure analytics tracking. By sending a properly formatted request, the administrator can create a blog that is either publicly visible or restricted to selected customers or customer groups, ensuring better content targeting and engagement control.
Request Body
Key | Type | Description |
---|---|---|
title | String | Title of the blog post. |
categories | Array | List of category objects the blog belongs to. |
selected_customers | Object | Contains customer and group IDs the blog is targeted to. |
image | Object | Information about the blog's associated image. |
content | String | Main body content of the blog. |
date | String | Date the blog was created or scheduled. |
status | String | Status of the blog post (e.g., draft, published). |
visibility | String | Defines who can view the blog (e.g., public, private, restricted). |
url | String | URL slug or permalink for the blog. |
type | String | Type of blog content (e.g., 'page_seo'). |
page_seo | Object | SEO-related settings for the blog. |
tag_name | String | Name of the custom HTML tag associated with the blog. |
tag_content | String | Content for the custom HTML tag. |
{
"blog": {
"title": "BLOG_TITLE",
"categories": [
{
"id": "CATEGORY_ID_1"
}
],
"selected_customers": {
"customers": [
"CUSTOMER_ID_1"
],
"groups": [
"GROUP_ID_1"
]
},
"image": {
"file_name": "IMAGE_FILE_NAME_1"
},
"content": "BLOG_CONTENT",
"date": "BLOG_DATE",
"status": "BLOG_STATUS",
"visibility": "BLOG_VISIBILITY",
"url": "BLOG_URL",
"type": "page_seo",
"page_seo": {
"overwite_auto_page_seo": "SEO_AUTO_PAGE_SEO",
"seo_title": "SEO_TITLE",
"seo_description": "SEO_DESCRIPTION",
"disable_search_engine_index": "SEO_DISABLE_SEARCH_ENGINE_INDEX",
"enable_canonical_url": "SEO_ENABLE_CANONICAL_URL",
"enable_meta_tag": "SEO_ENABLE_META_TAG",
"analytics_use_default": "SEO_ANALYTICS_USE_DEFAULT",
"tracking_enabled": "SEO_TRACKING_ENABLED",
"tracking_method": "SEO_TRACKING_METHOD",
"google_analytics_enabled": "SEO_GOOGLE_ANALYTICS_ENABLED",
"google_analytics_4": "SEO_GOOGLE_ANALYTICS_4",
"google_ads_conversion_id": "SEO_GOOGLE_ADS_CONVERSION_ID",
"google_ads_conversion_label": "SEO_GOOGLE_ADS_CONVERSION_LABEL",
"google_analytics_debug_mode_enabled": "SEO_GOOGLE_ANALYTICS_DEBUG_MODE_ENABLED",
"google_analytics_track_event_enable": "SEO_GOOGLE_ANALYTICS_TRACK_EVENT_ENABLE",
"google_analytics_add_to_cart_event": "SEO_GOOGLE_ANALYTICS_ADD_TO_CART_EVENT",
"google_analytics_view_item_event": "SEO_GOOGLE_ANALYTICS_VIEW_ITEM_EVENT",
"google_analytics_view_item_list_event": "SEO_GOOGLE_ANALYTICS_VIEW_ITEM_LIST_EVENT",
"google_analytics_begin_checkout_event": "SEO_GOOGLE_ANALYTICS_BEGIN_CHECKOUT_EVENT",
"google_analytics_purchase_event": "SEO_GOOGLE_ANALYTICS_PURCHASE_EVENT",
"google_analytics_remove_from_cart_event": "SEO_GOOGLE_ANALYTICS_REMOVE_FROM_CART_EVENT",
"google_analytics_view_cart_event": "SEO_GOOGLE_ANALYTICS_VIEW_CART_EVENT",
"google_analytics_add_payment_info_event": "SEO_GOOGLE_ANALYTICS_ADD_PAYMENT_INFO_EVENT",
"google_analytics_add_shipping_info_event": "SEO_GOOGLE_ANALYTICS_ADD_SHIPPING_INFO_EVENT",
"facebook_pixel_enabled": "SEO_FACEBOOK_PIXEL_ENABLED",
"facebook_pixel_id": "SEO_FACEBOOK_PIXEL_ID",
"facebook_pixel_track_event_enable": "SEO_FACEBOOK_PIXEL_TRACK_EVENT_ENABLE",
"facebook_pixel_add_payment_info_event": "SEO_FACEBOOK_PIXEL_ADD_PAYMENT_INFO_EVENT",
"facebook_pixel_add_to_cart_event": "SEO_FACEBOOK_PIXEL_ADD_TO_CART_EVENT",
"facebook_pixel_initiate_checkout_event": "SEO_FACEBOOK_PIXEL_INITIATE_CHECKOUT_EVENT",
"facebook_pixel_purchase_event": "SEO_FACEBOOK_PIXEL_PURCHASE_EVENT",
"facebook_pixel_search_event": "SEO_FACEBOOK_PIXEL_SEARCH_EVENT",
"custom_code_use_default": "SEO_CUSTOM_CODE_USE_DEFAULT",
"is_custom_code_enable_in_header": "SEO_IS_CUSTOM_CODE_ENABLE_IN_HEADER",
"custom_code_in_header": "SEO_CUSTOM_CODE_IN_HEADER",
"is_custom_code_enable_in_footer": "SEO_IS_CUSTOM_CODE_ENABLE_IN_FOOTER",
"custom_code_in_footer": "SEO_CUSTOM_CODE_IN_FOOTER"
},
"tag_name": "TAG_NAME",
"tag_content": "TAG_CONTENT"
}
}
Response
{
"blog": {
"id": BLOG_ID,
"name": "BLOG_TITLE",
"url": "BLOG_URL",
"content": "BLOG_CONTENT",
"date": "BLOG_DATE",
"is_published": BLOG_IS_PUBLISHED,
"visibility": "BLOG_VISIBILITY",
"categories": [
{
"id": CATEGORY_ID,
"name": "CATEGORY_NAME",
"is_disposible": CATEGORY_IS_DISPOSABLE,
"is_in_trash": CATEGORY_IS_IN_TRASH
}
],
"created_at": "CREATED_AT",
"is_disposible": BLOG_IS_DISPOSABLE,
"is_in_trash": BLOG_IS_IN_TRASH,
"image": {
"title": "IMAGE_TITLE",
"alternative_text": "IMAGE_ALT_TEXT",
"file_name": "IMAGE_FILE_NAME",
"link": "IMAGE_LINK"
},
"created_by": {
"id": CREATED_BY_ID,
"name": "CREATED_BY_NAME"
},
"selected_customers": [],
"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"
}
]
}
}
Creating Blog Comments
Endpoint: POST /admin/blogs/{blog_id}/comments
Purpose
This API allows users to add a comment to a specific blog post. The comment includes the commentator's name, email, and content. The system processes the comment and assigns it a status.
Path Parameters
Parameter | Type | Description |
---|---|---|
blog_id | Integer | The ID of the blog post to which the comment is being added. |
Query Parameters
No query parameters for this endpoint.
Use Case
A user wants to leave a comment on a blog post. The system captures the user's details and comment content, then processes the comment with an initial status of "pending." The comment can later be reviewed and approved or rejected by an administrator.
Request Body
Key | Type | Description |
---|---|---|
comment.name | String | Name of the person commenting. |
comment.email | String | Email address of the commenter. |
comment.content | String | Content of the comment itself. |
{
"blog": {
"comment": {
"name": "COMMENT_AUTHOR_NAME",
"email": "COMMENT_AUTHOR_EMAIL",
"content": "COMMENT_CONTENT"
}
}
}
Response
{
"id": "BLOG_ID",
"comment": {
"id": "COMMENT_ID",
"status": "COMMENT_STATUS",
"name": "COMMENT_AUTHOR_NAME",
"email": "COMMENT_AUTHOR_EMAIL",
"post_title": "BLOG_TITLE",
"content": "COMMENT_CONTENT",
"spam": "IS_SPAM",
"likes": "NUMBER_OF_LIKES",
"total_reply": "TOTAL_REPLIES",
"updated_at": "UPDATED_DATE_TIME",
"replies": []
}
}
Approving a Blog Comment
Endpoint: POST /admin/blogs/{blog_id}/comments/{comment_id}/approve
Purpose
This endpoint approves a specific comment on a blog post by updating its status. It marks the comment as "approved," allowing it to be displayed publicly on the blog post. It helps moderators or admins manage blog content by manually controlling which comments are published.
Path Parameters
Parameter | Type | Description |
---|---|---|
blog_id | number | Required. ID of the blog post. |
comment_id | number | Required. ID of the comment to approve. |
Query Parameters
No query parameters for this endpoint.
Use Case
An admin reviews pending comments on a blog post and approves selected ones that meet community guidelines. This is commonly used when blogs require moderation to prevent spam or inappropriate content from appearing publicly.
Request Body
No data is required for the request body.
Response
Returns the approved comment details, including its updated status ("approve"), the commentator’s name and email, post title, comment content, and metadata like count and replies. The returned object ensures admins can verify the comment's new status instantly after the action.
{
"id": "BLOG_ID",
"comment": {
"id": "COMMENT_ID",
"status": "COMMENT_STATUS",
"name": "COMMENT_AUTHOR_NAME",
"email": "COMMENT_AUTHOR_EMAIL",
"post_title": "BLOG_TITLE",
"content": "COMMENT_CONTENT",
"spam": "IS_SPAM",
"likes": "NUMBER_OF_LIKES",
"total_reply": "TOTAL_REPLIES",
"updated_at": "UPDATED_DATE_TIME",
"replies": []
}
}
Marking a Blog Comment as Spam
Endpoint: POST /admin/blogs/{blog_id}/comments/{comment_id}/mark-spam
Purpose
This endpoint marks a specific comment on a blog post as spam. It updates the comment's status to "spam," helping to filter out unwanted or inappropriate user-generated content from public view. It provides a manual control tool for blog administrators to maintain comment quality and relevance.
Path Parameters
Parameter | Type | Description |
---|---|---|
blog_id | number | Required. ID of the blog post. |
comment_id | number | Required. ID of the comment to mark spam. |
Query Parameters
No query parameters for this endpoint.
Use Case
An admin moderates blog comments and flags a comment as spam if it contains irrelevant advertisements, abusive language, or malicious content. This helps ensure that the blog remains a safe and clean platform for readers and genuine contributors.
Request Body
No data is required for the request body.
Response
Returns the updated comment object with its new status set to "spam." The response includes key details like commentator information, post title, comment content, spam status, likes, replies, and updated timestamp, confirming the action was successful.
{
"id": "BLOG_ID",
"comment": {
"id": "COMMENT_ID",
"status": "COMMENT_STATUS",
"name": "COMMENT_AUTHOR_NAME",
"email": "COMMENT_AUTHOR_EMAIL",
"post_title": "BLOG_TITLE",
"content": "COMMENT_CONTENT",
"spam": "IS_SPAM",
"likes": "NUMBER_OF_LIKES",
"total_reply": "TOTAL_REPLIES",
"updated_at": "UPDATED_DATE_TIME",
"replies": []
}
}
Creating Blog Categories
Endpoint: POST /admin/blog_categories
Purpose
This API allows administrators to create a new blog category within the system. It enables them to define the category name, description, associated blogs, an image, SEO configurations, and visibility settings.
Path Parameters
No path parameters for this endpoint.
Query Parameters
No query parameters for this endpoint.
Use Case
An administrator wants to create a new blog category on the platform, complete with a name, description, associated blogs, an image, and SEO settings. This API facilitates structured categorization of blogs, improving content organization and discoverability.
Request Body
Key | Type | Description |
---|---|---|
name | String | Name of the blog category. |
description | String | Description of the blog category. |
blogs | Array | List of blog references linked to this category. |
image | Object | Image information related to the category. |
content | String | Content or body text related to the category. |
date | String | Date/time associated with the blog category. |
status | String | Publication status (e.g., draft, published). |
visibility | String | Visibility level (e.g., public, private). |
url | String | URL slug for the category page. |
type | String | Type identifier, typically used for SEO settings. |
page_seo | Object | SEO configuration for the category. |
tag_name | String | Custom HTML tag name. |
tag_content | String | Content for the custom HTML tag. |
{
"blog_category": {
"name": "CATEGORY_NAME",
"description": "CATEGORY_DESCRIPTION",
"blogs": [
{
"id": "BLOG_ID"
}
],
"image": {
"title": "IMAGE_TITLE",
"alternative_text": "IMAGE_ALTERNATIVE_TEXT",
"file_name": "IMAGE_FILE_NAME",
"base64": "IMAGE_BASE64_ENCODED_STRING"
},
"content": "BLOG_CONTENT",
"date": "BLOG_DATE_TIME",
"status": "BLOG_STATUS",
"visibility": "BLOG_VISIBILITY",
"url": "BLOG_URL",
"type": "PAGE_SEO",
"page_seo": {
"overwite_auto_page_seo": "OVERWRITE_AUTO_PAGE_SEO",
"seo_title": "SEO_TITLE",
"seo_description": "SEO_DESCRIPTION",
"disable_search_engine_index": "DISABLE_SEARCH_ENGINE_INDEX",
"enable_canonical_url": "ENABLE_CANONICAL_URL",
"enable_meta_tag": "ENABLE_META_TAG",
"analytics_use_default": "ANALYTICS_USE_DEFAULT",
"tracking_enabled": "TRACKING_ENABLED",
"tracking_method": "TRACKING_METHOD",
"google_analytics_enabled": "GOOGLE_ANALYTICS_ENABLED",
"google_analytics_4": "GOOGLE_ANALYTICS_4",
"google_ads_conversion_id": "GOOGLE_ADS_CONVERSION_ID",
"google_ads_conversion_label": "GOOGLE_ADS_CONVERSION_LABEL",
"google_analytics_debug_mode_enabled": "GOOGLE_ANALYTICS_DEBUG_MODE_ENABLED",
"google_analytics_track_event_enable": "GOOGLE_ANALYTICS_TRACK_EVENT_ENABLE",
"google_analytics_add_to_cart_event": "GOOGLE_ANALYTICS_ADD_TO_CART_EVENT",
"google_analytics_view_item_event": "GOOGLE_ANALYTICS_VIEW_ITEM_EVENT",
"google_analytics_view_item_list_event": "GOOGLE_ANALYTICS_VIEW_ITEM_LIST_EVENT",
"google_analytics_begin_checkout_event": "GOOGLE_ANALYTICS_BEGIN_CHECKOUT_EVENT",
"google_analytics_purchase_event": "GOOGLE_ANALYTICS_PURCHASE_EVENT",
"google_analytics_remove_from_cart_event": "GOOGLE_ANALYTICS_REMOVE_FROM_CART_EVENT",
"google_analytics_view_cart_event": "GOOGLE_ANALYTICS_VIEW_CART_EVENT",
"google_analytics_add_payment_info_event": "GOOGLE_ANALYTICS_ADD_PAYMENT_INFO_EVENT",
"google_analytics_add_shipping_info_event": "GOOGLE_ANALYTICS_ADD_SHIPPING_INFO_EVENT",
"facebook_pixel_enabled": "FACEBOOK_PIXEL_ENABLED",
"facebook_pixel_id": "FACEBOOK_PIXEL_ID",
"facebook_pixel_track_event_enable": "FACEBOOK_PIXEL_TRACK_EVENT_ENABLE",
"facebook_pixel_add_payment_info_event": "FACEBOOK_PIXEL_ADD_PAYMENT_INFO_EVENT",
"facebook_pixel_add_to_cart_event": "FACEBOOK_PIXEL_ADD_TO_CART_EVENT",
"facebook_pixel_initiate_checkout_event": "FACEBOOK_PIXEL_INITIATE_CHECKOUT_EVENT",
"facebook_pixel_purchase_event": "FACEBOOK_PIXEL_PURCHASE_EVENT",
"facebook_pixel_search_event": "FACEBOOK_PIXEL_SEARCH_EVENT",
"custom_code_use_default": "CUSTOM_CODE_USE_DEFAULT",
"is_custom_code_enable_in_header": "IS_CUSTOM_CODE_ENABLE_IN_HEADER",
"custom_code_in_header": "CUSTOM_CODE_IN_HEADER",
"is_custom_code_enable_in_footer": "IS_CUSTOM_CODE_ENABLE_IN_FOOTER",
"custom_code_in_footer": "CUSTOM_CODE_IN_FOOTER"
},
"tag_name": "TAG_NAME",
"tag_content": "TAG_CONTENT"
}
}
Response
{
"blog_category": {
"id": "CATEGORY_ID",
"name": "CATEGORY_NAME",
"url": "CATEGORY_URL",
"description": "CATEGORY_DESCRIPTION",
"is_disposible": "IS_DISPOSIBLE",
"is_in_trash": "IS_IN_TRASH",
"image": {
"title": "IMAGE_TITLE",
"alternative_text": "IMAGE_ALTERNATIVE_TEXT",
"file_name": "IMAGE_FILE_NAME",
"link": "IMAGE_LINK"
},
"created_at": "CREATED_AT",
"updated_at": "UPDATED_AT",
"seo_configs": [
{
"id": 3484,
"value": "off",
"type": "page_seo",
"config_key": "is_custom_code_enable_in_header"
},
{
"id": 3487,
"value": "false",
"type": "page_seo",
"config_key": "facebook_pixel_initiate_checkout_event"
},
{
"id": 3490,
"value": "false",
"type": "page_seo",
"config_key": "google_analytics_enabled"
},
{
"id": 3493,
"value": "false",
"type": "page_seo",
"config_key": "overwite_auto_page_seo"
},
{
"id": 3496,
"value": "AW-XXXXXXX",
"type": "page_seo",
"config_key": "google_ads_conversion_id"
},
{
"id": 3499,
"value": "false",
"type": "page_seo",
"config_key": "google_analytics_view_item_event"
},
{
"id": 3502,
"value": "false",
"type": "page_seo",
"config_key": "google_analytics_view_cart_event"
},
{
"id": 3505,
"value": "false",
"type": "page_seo",
"config_key": "facebook_pixel_purchase_event"
},
{
"id": 3508,
"value": "label_xx",
"type": "page_seo",
"config_key": "google_ads_conversion_label"
},
{
"id": 3511,
"value": "true",
"type": "page_seo",
"config_key": "enable_meta_tag"
},
{
"id": 3514,
"value": "false",
"type": "page_seo",
"config_key": "google_analytics_debug_mode_enabled"
},
{
"id": 3517,
"value": "false",
"type": "page_seo",
"config_key": "google_analytics_add_shipping_info_event"
},
{
"id": 3520,
"value": "false",
"type": "page_seo",
"config_key": "custom_code_use_default"
},
{
"id": 3523,
"value": "Default SEO Description for the blog.",
"type": "page_seo",
"config_key": "seo_description"
},
{
"id": 3526,
"value": "UA-XXXXX-X",
"type": "page_seo",
"config_key": "google_analytics4"
},
{
"id": 3529,
"value": "false",
"type": "page_seo",
"config_key": "facebook_pixel_add_payment_info_event"
},
{
"id": 3532,
"value": "google-analytics",
"type": "page_seo",
"config_key": "tracking_method"
},
{
"id": 3535,
"value": "false",
"type": "page_seo",
"config_key": "facebook_pixel_track_event_enable"
},
{
"id": 3538,
"value": "false",
"type": "page_seo",
"config_key": "facebook_pixel_add_to_cart_event"
},
{
"id": 3541,
"value": "false",
"type": "page_seo",
"config_key": "google_analytics_view_item_list_event"
},
{
"id": 3544,
"value": "false",
"type": "page_seo",
"config_key": "google_analytics_begin_checkout_event"
},
{
"id": 3547,
"value": "true",
"type": "page_seo",
"config_key": "enable_canonical_url"
},
{
"id": 3550,
"value": "false",
"type": "page_seo",
"config_key": "facebook_pixel_enabled"
},
{
"id": 3553,
"value": "Default SEO Title",
"type": "page_seo",
"config_key": "seo_title"
},
{
"id": 3556,
"value": "false",
"type": "page_seo",
"config_key": "google_analytics_remove_from_cart_event"
},
{
"id": 3559,
"value": "false",
"type": "page_seo",
"config_key": "google_analytics_track_event_enable"
},
{
"id": 3562,
"value": "<script>...</script>",
"type": "page_seo",
"config_key": "custom_code_in_footer"
},
{
"id": 3565,
"value": "false",
"type": "page_seo",
"config_key": "google_analytics_purchase_event"
},
{
"id": 3568,
"value": "123456789",
"type": "page_seo",
"config_key": "facebook_pixel_id"
},
{
"id": 3571,
"value": "false",
"type": "page_seo",
"config_key": "facebook_pixel_search_event"
},
{
"id": 3574,
"value": "<script>...</script>",
"type": "page_seo",
"config_key": "custom_code_in_header"
},
{
"id": 3577,
"value": "off",
"type": "page_seo",
"config_key": "is_custom_code_enable_in_footer"
},
{
"id": 3580,
"value": "true",
"type": "page_seo",
"config_key": "analytics_use_default"
},
{
"id": 3583,
"value": "false",
"type": "page_seo",
"config_key": "google_analytics_add_payment_info_event"
},
{
"id": 3586,
"value": "false",
"type": "page_seo",
"config_key": "disable_search_engine_index"
},
{
"id": 3589,
"value": "false",
"type": "page_seo",
"config_key": "tracking_enabled"
},
{
"id": 3592,
"value": "false",
"type": "page_seo",
"config_key": "google_analytics_add_to_cart_event"
}
]
}
}