» Blog SDK Documentation

Getting All Blog Posts

Function: admin_blog_get_list()

Purpose

This function retrieves a list of blog posts available for administrators. The admin_blog_get_list() function provides full access to all blog posts, regardless of publication status or visibility settings. This allows administrators to efficiently manage content, review unpublished drafts, update SEO configurations, and ensure smooth blog management. Additionally, it supports filtering, sorting, and pagination to streamline the retrieval process, making it easier to navigate large collections of blog posts.

Parameters

This function does not require any input parameters.

Use Case

The admin_blog_get_list() function is used by administrators to oversee all blog posts, including drafts and restricted posts that are not visible to the public. This helps businesses manage content strategies, optimize SEO settings, and keep track of published and unpublished blog entries. Administrators can review, update, and manage blog categories, SEO configurations, and visibility settings, ensuring better content control and marketing effectiveness.

def admin_blog_get_list():
    SDKConfig.PRINT_REQUEST_DATA = True
    SDKConfig.PRINT_RAW_RESPONSE = True

    webcommander_sdk: WebCommanderSDK = WebCommanderSDK().init_sdk(request_token_dto=CommonData.get_request_token_dto())

    try:
        response = webcommander_sdk.admin_blog.list()
        print(response)
    except WCException as ab:
        print(ab)
        print(ab.get_errors())
        print(ab.raw_response)

Response

This function returns a list of blog posts along with their details, including metadata, content, SEO configurations, and associated categories. The response also supports pagination for efficiently handling large blog collections.

BlogListDTO(
    blogs=[
        BlogDataDTO(
            id=BLOG_ID,
            name="BLOG_NAME",
            url="BLOG_URL",
            content="BLOG_CONTENT",
            date="BLOG_DATE",
            isPublished=BLOG_IS_PUBLISHED,
            visibility="BLOG_VISIBILITY",
            categories=[
                BlogCategoryDTO(
                    id=CATEGORY_ID,
                    name="CATEGORY_NAME",
                    isDisposible=CATEGORY_IS_DISPOSABLE,
                    isInTrash=CATEGORY_IS_IN_TRASH
                )
            ],
            createdAt="BLOG_CREATED_AT",
            isDisposible=BLOG_IS_DISPOSABLE,
            isInTrash=BLOG_IS_IN_TRASH,
            image=BlogImageDTO(
                title="IMAGE_TITLE",
                alternativeText="IMAGE_ALT_TEXT",
                fileName="IMAGE_FILE_NAME",
                link="IMAGE_LINK"
            ),
            createdBy=BlogCreatorDTO(id=CREATED_BY_ID, name="CREATED_BY_NAME"),
            selectedCustomers=[],
            seoConfigs=[
                BlogSEOConfigDTO(id=SEO_CONFIG_ID_1, value="SEO_CONFIG_VALUE_1", type="SEO_CONFIG_TYPE_1", configKey="SEO_CONFIG_KEY_1"),
                BlogSEOConfigDTO(id=SEO_CONFIG_ID_2, value="SEO_CONFIG_VALUE_2", type="SEO_CONFIG_TYPE_2", configKey="SEO_CONFIG_KEY_2"),
                BlogSEOConfigDTO(id=SEO_CONFIG_ID_3, value="SEO_CONFIG_VALUE_3", type="SEO_CONFIG_TYPE_3", configKey="SEO_CONFIG_KEY_3"),
                BlogSEOConfigDTO(id=SEO_CONFIG_ID_4, value="SEO_CONFIG_VALUE_4", type="SEO_CONFIG_TYPE_4", configKey="SEO_CONFIG_KEY_4")
            ]
        )
    ],
    pagination=PaginationDTO(
        records=RECORDS_TOTAL,
        limit=LIMIT,
        offset=OFFSET,
        nextPage="NEXT_PAGE_URL",
        previousPage="PREVIOUS_PAGE_URL"
    )
)

Getting Specific Blog Post Details

Function: admin_blog_get_info()

Purpose

This function retrieves detailed information about a specific blog post using its unique identifier. It provides full access to the blog’s metadata, content, SEO settings, and customer visibility restrictions. Administrators can use this function to review, update, and analyze individual blog posts for better content management and optimization. The function is particularly valuable for businesses that need to maintain content quality, verify accuracy, and ensure that blog posts align with branding and marketing goals. Additionally, it helps in identifying SEO opportunities, tracking content revisions, and ensuring that each blog post reaches the appropriate target audience.

Parameters

ParameterTypeDescription
idStringThe unique identifier of the blog post.

Use Case

The admin_blog_get_info() function is essential for retrieving in-depth information about a particular blog post. It helps administrators verify content, review SEO settings, manage visibility settings, and ensure that the blog post aligns with content strategies. This function is useful for auditing blog posts, tracking engagement, and ensuring compliance with business guidelines. Additionally, it aids in performing quality checks, enabling administrators to identify necessary improvements or updates before making the post publicly available.

def admin_blog_get_info():
    SDKConfig.PRINT_REQUEST_DATA = True
    SDKConfig.PRINT_RAW_RESPONSE = True
    webcommander_sdk: WebCommanderSDK = WebCommanderSDK().init_sdk(request_token_dto=CommonData.get_request_token_dto())

    try:
        response = webcommander_sdk.admin_blog.info(id="10")
        print(response)
    except WCException as ab:
        print(ab)
        print(ab.get_errors())
        print(ab.raw_response)

Response

BlogInfoResponseDTO(
    blog=BlogDataDTO(
        id=BLOG_ID,
        name="BLOG_NAME",
        url="BLOG_URL",
        content="BLOG_CONTENT",
        date="BLOG_DATE",
        isPublished=BLOG_IS_PUBLISHED,
        visibility="BLOG_VISIBILITY",
        categories=[],
        createdAt="BLOG_CREATED_AT",
        isDisposible=BLOG_IS_DISPOSABLE,
        isInTrash=BLOG_IS_IN_TRASH,
        image=BlogImageDTO(
            title="IMAGE_TITLE",
            alternativeText="IMAGE_ALT_TEXT",
            fileName="IMAGE_FILE_NAME",
            link="IMAGE_LINK"
        ),
        createdBy=BlogCreatorDTO(
            id=CREATED_BY_ID,
            name="CREATED_BY_NAME"
        ),
        selectedCustomers=BlogSelectedCustomersDTO(
            customers=[
                BlogCustomerDTO(id=CUSTOMER_ID_1, name="CUSTOMER_NAME_1"),
                BlogCustomerDTO(id=CUSTOMER_ID_2, name="CUSTOMER_NAME_2"),
                BlogCustomerDTO(id=CUSTOMER_ID_3, name="CUSTOMER_NAME_3")
            ],
            groups=[
                BlogCustomerDTO(id=GROUP_ID_1, name="GROUP_NAME_1"),
                BlogCustomerDTO(id=GROUP_ID_2, name="GROUP_NAME_2"),
                BlogCustomerDTO(id=GROUP_ID_3, name="GROUP_NAME_3"),
                BlogCustomerDTO(id=GROUP_ID_4, name="GROUP_NAME_4")
            ]
        ),
        seoConfigs=[
            BlogSEOConfigDTO(id=SEO_CONFIG_ID_1, value="SEO_CONFIG_VALUE_1", type="SEO_CONFIG_TYPE_1", configKey="SEO_CONFIG_KEY_1"),
            BlogSEOConfigDTO(id=SEO_CONFIG_ID_2, value="SEO_CONFIG_VALUE_2", type="SEO_CONFIG_TYPE_2", configKey="SEO_CONFIG_KEY_2"),
            BlogSEOConfigDTO(id=SEO_CONFIG_ID_3, value="SEO_CONFIG_VALUE_3", type="SEO_CONFIG_TYPE_3", configKey="SEO_CONFIG_KEY_3")
        ]
    )
)

Getting Blog Count

Function: admin_blog_get_count()

Purpose

This function retrieves the total count of blog posts available in the system for administrators. It provides an efficient way to check the number of blogs without retrieving full blog details, helping in analytics, reporting, and inventory tracking. Administrators can use this function to monitor content volume, assess engagement trends, and manage blog-related operations.

Parameters

This function does not require any input parameters.

Use Case

The admin_blog_get_count() function is primarily used by administrators to quickly obtain the total number of blog posts in the system. This is useful for dashboards, analytics, or determining if new content needs to be added. Unlike fetching full blog details, this function ensures optimized performance by only retrieving the count.

def admin_blog_get_count():
    webcommander_sdk: WebCommanderSDK = WebCommanderSDK().init_sdk(request_token_dto=CommonData.get_request_token_dto())

    try:
        response = webcommander_sdk.admin_blog.count()
        print(response)
    except WCException as ab:
        print(ab)
        print(ab.get_errors())
        print(ab.raw_response)

Response

CountResponseDTO(count=NUMBER)

Getting Blog Comments List

Function: admin_blog_get_comments_list()

Purpose

This function retrieves a list of comments for a specific blog post, allowing administrators to manage user interactions. It provides details on comment status (e.g., approved, pending, spam), author information, likes, replies, and timestamps. Administrators can use this function to monitor engagement, moderate discussions, and handle spam effectively.

Parameters

ParameterTypeDescription
idstringThe unique identifier of the blog post for which comments are to be fetched.

Use Case

Administrators can use the admin_blog_get_comments_list() function to efficiently manage blog discussions by retrieving all comments related to a specific blog post. This function helps in identifying pending, approved, and spam comments, making moderation easier. By fetching detailed comment data, administrators can track engagement, review user interactions, and respond to customer feedback. Additionally, the function provides visibility into nested replies, allowing admins to monitor discussion threads effectively. This feature is essential for ensuring quality control, improving content interaction, and maintaining a professional and spam-free comment section.

def admin_blog_get_comments_list():
    webcommander_sdk: WebCommanderSDK = WebCommanderSDK().init_sdk(request_token_dto=CommonData.get_request_token_dto())

    try:
        response = webcommander_sdk.admin_blog.comments_list(id="1")
        print(response)
    except WCException as ab:
        print(ab)
        print(ab.get_errors())
        print(ab.raw_response)

Response

BlogCommentsListDTO(
    comments=[
        BlogCommentDTO(
            id=COMMENT_ID_1,
            status="COMMENT_STATUS_1",
            name="COMMENTATOR_NAME_1",
            email="COMMENTATOR_EMAIL_1",
            postTitle="COMMENT_POST_TITLE_1",
            content="COMMENT_CONTENT_1",
            spam=COMMENT_IS_SPAM_1,
            likes=COMMENT_LIKES_1,
            totalReply=COMMENT_TOTAL_REPLY_1,
            updatedAt="COMMENT_UPDATED_AT_1",
            replies=[]
        ),
        BlogCommentDTO(
            id=COMMENT_ID_2,
            status="COMMENT_STATUS_2",
            name="COMMENTATOR_NAME_2",
            email="COMMENTATOR_EMAIL_2",
            postTitle="COMMENT_POST_TITLE_2",
            content="COMMENT_CONTENT_2",
            spam=COMMENT_IS_SPAM_2,
            likes=COMMENT_LIKES_2,
            totalReply=COMMENT_TOTAL_REPLY_2,
            updatedAt="COMMENT_UPDATED_AT_2",
            replies=[
                BlogCommentRepliesDTO(
                    id=REPLY_ID_1,
                    status="REPLY_STATUS_1",
                    name="REPLY_NAME_1",
                    email="REPLY_EMAIL_1",
                    postTitle="REPLY_POST_TITLE_1",
                    content="REPLY_CONTENT_1",
                    spam=REPLY_IS_SPAM_1,
                    likes=REPLY_LIKES_1,
                    createdAt="REPLY_CREATED_AT_1",
                    updatedAt="REPLY_UPDATED_AT_1"
                )
            ]
        )
    ],
    id=BLOG_ID
)

Getting Specific Blog Comment

Function: admin_blog_comment_details()

Purpose

This function retrieves detailed information about a specific comment on a blog post. It allows administrators to view the comment’s status, author details, content, likes, replies, and timestamps. By providing insights into individual comments, this function helps administrators moderate discussions, handle spam, and manage engagement on blog posts.

Parameters

ParameterTypeDescription
idstringThe unique identifier of the blog post containing the comment.
comment_idstringThe unique identifier of the specific comment to retrieve details for.

Use Case

Administrators can use the admin_blog_comment_details() function to fetch comprehensive details about a specific comment on a blog post. This function is useful for moderation purposes, as it allows admins to review comment content, author details, and engagement metrics such as likes and replies. By retrieving the full comment history, including its replies, administrators can ensure proper content moderation, assess user engagement, and take necessary actions on inappropriate or spam comments. This function is particularly beneficial for businesses that rely on blog interactions to foster customer engagement and maintain a professional discussion environment.

def admin_blog_comment_details():
    SDKConfig.PRINT_REQUEST_DATA = True
    SDKConfig.PRINT_RAW_RESPONSE = True
    webcommander_sdk: WebCommanderSDK = WebCommanderSDK().init_sdk(request_token_dto=CommonData.get_request_token_dto())

    try:
        response = webcommander_sdk.admin_blog.comment_details(id="10", comment_id="10")
        print(response)
    except WCException as ab:
        print(ab)
        print(ab.get_errors())
        print(ab.raw_response)

Response

BlogCommentInfoDTO(
    comment=BlogCommentDTO(
        id=COMMENT_ID,
        status="COMMENT_STATUS",
        name="COMMENTATOR_NAME",
        email="COMMENTATOR_EMAIL",
        postTitle="COMMENT_POST_TITLE",
        content="COMMENT_CONTENT",
        spam=COMMENT_IS_SPAM,
        likes=COMMENT_LIKES,
        totalReply=COMMENT_TOTAL_REPLY,
        updatedAt="COMMENT_UPDATED_AT",
        replies=[
            BlogCommentRepliesDTO(
                id=REPLY_ID,
                status="REPLY_STATUS",
                name="REPLY_NAME",
                email="REPLY_EMAIL",
                postTitle="REPLY_POST_TITLE",
                content="REPLY_CONTENT",
                spam=REPLY_IS_SPAM,
                likes=REPLY_LIKES,
                createdAt="REPLY_CREATED_AT",
                updatedAt="REPLY_UPDATED_AT"
            )
        ]
    ),
    id=COMMENT_INFO_ID
)

Deleting a Blog Post

Function: admin_blog_delete()

Purpose

This function allows administrators to delete a specific blog post from the system. Removing a blog post can be useful for managing outdated, irrelevant, or inappropriate content. This ensures that only relevant and high-quality posts remain visible on the platform.

Parameters

ParameterTypeDescription
idstringThe unique identifier of the blog post to be deleted.

Use Case

Administrators can use the admin_blog_delete() function to remove a blog post from the system when it is no longer needed. This function is particularly useful for managing blog content by removing outdated articles, posts with incorrect information, or those that violate content guidelines. Since deleting a blog post is a permanent action, it helps businesses maintain a clean and relevant content library, ensuring that customers and visitors access only the most up-to-date and appropriate blog content.

def admin_blog_delete():
    webcommander_sdk: WebCommanderSDK = WebCommanderSDK().init_sdk(request_token_dto=CommonData.get_request_token_dto())

    try:
        response = webcommander_sdk.admin_blog.delete(id="1")
        print(response)
    except WCException as ab:
        print(ab)
        print(ab.get_errors())
        print(ab.raw_response)

Response

This function returns an HTTP 204 No Content status, indicating that the blog post has been successfully deleted and there is no additional response body.

Creating a Blog Post

Function: admin_blog_create()

Purpose

This function allows administrators to create a new blog post with various attributes, including content, categories, images, SEO settings, and visibility options. It helps in managing and publishing content efficiently, ensuring better engagement and search engine optimization.

Parameters

ParameterTypeDescription
titlestringThe title of the blog post.
categorieslistA list of category IDs associated with the blog post.
imageobjectContains image details such as filename and base64-encoded content.
contentstringThe main body content of the blog post.
datestringThe publication date of the blog post in YYYY-MM-DD HH:MM:SS format.
statusstringThe status of the blog post (e.g., PUBLISHED).
visibilitystringThe visibility setting of the blog post (OPEN or PRIVATE).
urlstringThe URL slug for the blog post.
typestringThe type of blog post (page_seo for SEO-enabled posts).
pageSeoobjectSEO settings such as title, description, and indexing options.
tagNamestringThe tag name associated with the blog post.
tagContentstringThe content for the tag.

Use Case

Administrators can use this function to create and publish blog posts efficiently, including adding SEO settings, images, and categories. This function ensures that blog posts are structured with the necessary metadata for search engine visibility. It is particularly useful for content management systems that require automated blog post creation with predefined SEO configurations. By using the SEO settings, businesses can improve search engine rankings and attract more visitors to their site. The ability to define visibility settings and categories also enhances content organization and accessibility.

def admin_blog_create():
    SDKConfig.PRINT_REQUEST_DATA = True
    SDKConfig.PRINT_RAW_RESPONSE = True
    webcommander_sdk: WebCommanderSDK = WebCommanderSDK().init_sdk(request_token_dto=CommonData.get_request_token_dto())

       try:
        blog_request_data = BlogRequestDTO(
            blog=BlogCreateDataDTO(
                title="BLOG_TITLE",
                categories=[BlogCategoryDTO(id=CATEGORY_ID)],
                image=BlogImageCreateDTO(
                    fileName="IMAGE_FILE_NAME",
                    base64="IMAGE_BASE64"
                ),
                content="BLOG_CONTENT",
                date="BLOG_DATE",
                status="BLOG_STATUS",
                visibility="BLOG_VISIBILITY",
                url="BLOG_URL",
                type="BLOG_TYPE",
                pageSeo=BlogSEOSettingsDTO(
                    overwiteAutoPageSeo=PAGE_SEO_OVERWRITE_AUTO,
                    seoTitle="PAGE_SEO_TITLE",
                    seoDescription="PAGE_SEO_DESCRIPTION",
                    disableSearchEngineIndex=PAGE_SEO_DISABLE_INDEX,
                    enableCanonicalUrl=PAGE_SEO_ENABLE_CANONICAL,
                    enableMetaTag=PAGE_SEO_ENABLE_META,
                    analyticsUseDefault=PAGE_SEO_ANALYTICS_USE_DEFAULT,
                    trackingEnabled=PAGE_SEO_TRACKING_ENABLED,
                    trackingMethod="PAGE_SEO_TRACKING_METHOD",
                    googleAnalyticsEnabled=PAGE_SEO_GOOGLE_ANALYTICS_ENABLED,
                    googleAnalytics4="PAGE_SEO_GOOGLE_ANALYTICS_4",
                    googleAdsConversionId="PAGE_SEO_GOOGLE_ADS_CONVERSION_ID",
                    googleAdsConversionLabel="PAGE_SEO_GOOGLE_ADS_CONVERSION_LABEL",
                    googleAnalyticsDebugModeEnabled=PAGE_SEO_GOOGLE_ANALYTICS_DEBUG_MODE,
                    googleAnalyticsTrackEventEnable=PAGE_SEO_GOOGLE_ANALYTICS_TRACK_EVENT,
                    googleAnalyticsAddToCartEvent=PAGE_SEO_GOOGLE_ANALYTICS_ADD_TO_CART,
                    googleAnalyticsViewItemEvent=PAGE_SEO_GOOGLE_ANALYTICS_VIEW_ITEM,
                    googleAnalyticsViewItemListEvent=PAGE_SEO_GOOGLE_ANALYTICS_VIEW_ITEM_LIST,
                    googleAnalyticsBeginCheckoutEvent=PAGE_SEO_GOOGLE_ANALYTICS_BEGIN_CHECKOUT,
                    googleAnalyticsPurchaseEvent=PAGE_SEO_GOOGLE_ANALYTICS_PURCHASE,
                    googleAnalyticsRemoveFromCartEvent=PAGE_SEO_GOOGLE_ANALYTICS_REMOVE_FROM_CART,
                    googleAnalyticsViewCartEvent=PAGE_SEO_GOOGLE_ANALYTICS_VIEW_CART,
                    googleAnalyticsAddPaymentInfoEvent=PAGE_SEO_GOOGLE_ANALYTICS_ADD_PAYMENT_INFO,
                    googleAnalyticsAddShippingInfoEvent="PAGE_SEO_GOOGLE_ANALYTICS_ADD_SHIPPING_INFO",
                    facebookPixelEnabled="PAGE_SEO_FACEBOOK_PIXEL_ENABLED",
                    facebookPixelId="PAGE_SEO_FACEBOOK_PIXEL_ID",
                    facebookPixelTrackEventEnable=PAGE_SEO_FACEBOOK_PIXEL_TRACK_EVENT,
                    facebookPixelAddPaymentInfoEvent=PAGE_SEO_FACEBOOK_PIXEL_ADD_PAYMENT_INFO,
                    facebookPixelAddToCartEvent=PAGE_SEO_FACEBOOK_PIXEL_ADD_TO_CART,
                    facebookPixelInitiateCheckoutEvent=PAGE_SEO_FACEBOOK_PIXEL_INITIATE_CHECKOUT,
                    facebookPixelPurchaseEvent=PAGE_SEO_FACEBOOK_PIXEL_PURCHASE,
                    facebookPixelSearchEvent=PAGE_SEO_FACEBOOK_PIXEL_SEARCH,
                    customCodeUseDefault=PAGE_SEO_CUSTOM_CODE_USE_DEFAULT,
                    isCustomCodeEnableInHeader="PAGE_SEO_CUSTOM_CODE_HEADER_ENABLE",
                    customCodeInHeader="PAGE_SEO_CUSTOM_CODE_HEADER",
                    isCustomCodeEnableInFooter="PAGE_SEO_CUSTOM_CODE_FOOTER_ENABLE",
                    customCodeInFooter="PAGE_SEO_CUSTOM_CODE_FOOTER"
                ),
                tagName="BLOG_TAG_NAME",
                tagContent="BLOG_TAG_CONTENT"
            )
        )
        response = webcommander_sdk.admin_blog.create(request_data=blog_request_data)
        print(response)
    except WCException as ab:
        print(ab)
        print(ab.get_errors())
        print(ab.raw_response)

Response

BlogInfoResponseDTO(
    blog=BlogDataDTO(
        id=BLOG_ID,
        name="BLOG_NAME",
        url="BLOG_URL",
        content="BLOG_CONTENT",
        date="BLOG_DATE",
        isPublished=BLOG_IS_PUBLISHED,
        visibility="BLOG_VISIBILITY",
        categories=[
            BlogCategoryDTO(
                id=CATEGORY_ID,
                name="CATEGORY_NAME",
                isDisposible=CATEGORY_IS_DISPOSABLE,
                isInTrash=CATEGORY_IS_IN_TRASH
            )
        ],
        createdAt="BLOG_CREATED_AT",
        isDisposible=BLOG_IS_DISPOSABLE,
        isInTrash=BLOG_IS_IN_TRASH,
        image=BlogImageDTO(
            title="IMAGE_TITLE",
            alternativeText="IMAGE_ALT_TEXT",
            fileName="IMAGE_FILE_NAME",
            link="IMAGE_LINK"
        ),
        createdBy=BlogCreatorDTO(
            id=CREATED_BY_ID,
            name="CREATED_BY_NAME"
        ),
        selectedCustomers=[],
        seoConfigs=[
            BlogSEOConfigDTO(
                id=SEO_CONFIG_ID,
                value="SEO_CONFIG_VALUE",
                type="SEO_CONFIG_TYPE",
                configKey="SEO_CONFIG_KEY"
            ) for SEO_CONFIG_ID, SEO_CONFIG_VALUE, SEO_CONFIG_TYPE, SEO_CONFIG_KEY in [
                (3595, "off", "page_seo", "is_custom_code_enable_in_header"),
                (3598, "false", "page_seo", "facebook_pixel_initiate_checkout_event"),
                (3601, "false", "page_seo", "google_analytics_enabled"),
                (3604, "false", "page_seo", "overwite_auto_page_seo"),
                (3607, "googleAdsConversionId", "page_seo", "google_ads_conversion_id"),
                (3610, "false", "page_seo", "google_analytics_view_item_event"),
                (3613, "false", "page_seo", "google_analytics_view_cart_event"),
                (3616, "false", "page_seo", "facebook_pixel_purchase_event"),
                (3619, "googleAdsConversionLabel", "page_seo", "google_ads_conversion_label"),
                (3622, "true", "page_seo", "enable_meta_tag"),
                (3625, "false", "page_seo", "google_analytics_debug_mode_enabled"),
                (3628, "false", "page_seo", "google_analytics_add_shipping_info_event"),
                (3631, "false", "page_seo", "custom_code_use_default"),
                (3634, "Put a short one or two lines of SEO to briefly explain what it is about.", "page_seo", "seo_description"),
                (3637, "false", "page_seo", "facebook_pixel_add_payment_info_event"),
                (3640, "googleAnalytics4", "page_seo", "google_analytics4"),
                (3643, "google-analytics", "page_seo", "tracking_method"),
                (3646, "false", "page_seo", "facebook_pixel_track_event_enable"),
                (3649, "false", "page_seo", "facebook_pixel_add_to_cart_event"),
                (3652, "false", "page_seo", "google_analytics_view_item_list_event"),
                (3655, "false", "page_seo", "google_analytics_begin_checkout_event"),
                (3658, "true", "page_seo", "enable_canonical_url"),
                (3661, "false", "page_seo", "facebook_pixel_enabled"),
                (3664, "SEO Title", "page_seo", "seo_title"),
                (3667, "false", "page_seo", "google_analytics_remove_from_cart_event"),
                (3670, "false", "page_seo", "google_analytics_track_event_enable"),
                (3673, "Footer", "page_seo", "custom_code_in_footer"),
                (3676, "false", "page_seo", "google_analytics_purchase_event"),
                (3679, "facebookPixelId", "page_seo", "facebook_pixel_id"),
                (3682, "false", "page_seo", "facebook_pixel_search_event"),
                (3685, "Header", "page_seo", "custom_code_in_header"),
                (3688, "off", "page_seo", "is_custom_code_enable_in_footer"),
                (3691, "false", "page_seo", "analytics_use_default"),
                (3694, "false", "page_seo", "google_analytics_add_payment_info_event"),
                (3697, "false", "page_seo", "disable_search_engine_index"),
                (3700, "false", "page_seo", "tracking_enabled"),
                (3703, "false", "page_seo", "google_analytics_add_to_cart_event")
            ]
        ]
    )
)

Updating a Blog Post

Function: admin_blog_update()

Purpose

This function allows administrators to update an existing blog post with new content, categories, images, SEO settings, and visibility options. It ensures that blog posts remain up-to-date, optimized for search engines, and aligned with business needs.

Parameters

ParameterTypeDescription
idstringThe unique identifier of the blog post to update.
titlestringThe updated title of the blog post.
categorieslistA list of category IDs associated with the blog post.
imageobjectContains image details such as filename and base64-encoded content.
contentstringThe updated body content of the blog post.
datestringThe updated publication date of the blog post in YYYY-MM-DD HH:MM:SS format.
statusstringThe status of the blog post (e.g., PUBLISHED).
visibilitystringThe visibility setting of the blog post (OPEN or PRIVATE).
urlstringThe updated URL slug for the blog post.
typestringThe type of blog post (page_seo for SEO-enabled posts).
pageSeoobjectSEO settings such as title, description, indexing options, and tracking configurations.
tagNamestringThe tag name associated with the blog post.
tagContentstringThe content for the tag.

Use Case

Administrators use this function to modify existing blog posts while maintaining SEO integrity. This update process is crucial for ensuring that outdated content is refreshed, categories remain relevant, and blog posts stay optimized for search engines. The function also allows updating tracking configurations for platforms like Google Analytics and Facebook Pixel.

def admin_blog_update():
    SDKConfig.PRINT_REQUEST_DATA = False
    SDKConfig.PRINT_RAW_RESPONSE = False
    webcommander_sdk: WebCommanderSDK = WebCommanderSDK().init_sdk(request_token_dto=CommonData.get_request_token_dto())
    try:
        blog_request_data = BlogRequestDTO(
            blog=BlogCreateDataDTO(
                title="BLOG_TITLE",
                categories=[BlogCategoryDTO(id=CATEGORY_ID)],
                image=BlogImageCreateDTO(
                    fileName="IMAGE_FILE_NAME",
                    base64="IMAGE_BASE64_DATA"
                ),
                content="BLOG_CONTENT",
                date="BLOG_DATE",
                status="BLOG_STATUS",
                visibility="BLOG_VISIBILITY",
                url="BLOG_URL",
                type="BLOG_TYPE",
                pageSeo=BlogSEOSettingsDTO(
                    overwiteAutoPageSeo=OVERWRITE_AUTO_PAGE_SEO,
                    seoTitle="SEO_TITLE",
                    seoDescription="SEO_DESCRIPTION",
                    disableSearchEngineIndex=DISABLE_SEARCH_ENGINE_INDEX,
                    enableCanonicalUrl=ENABLE_CANONICAL_URL,
                    enableMetaTag=ENABLE_META_TAG,
                    analyticsUseDefault=ANALYTICS_USE_DEFAULT,
                    trackingEnabled=TRACKING_ENABLED,
                    trackingMethod="TRACKING_METHOD",
                    googleAnalyticsEnabled=GOOGLE_ANALYTICS_ENABLED,
                    googleAnalytics4="GOOGLE_ANALYTICS_4",
                    googleAdsConversionId="GOOGLE_ADS_CONVERSION_ID",
                    googleAdsConversionLabel="GOOGLE_ADS_CONVERSION_LABEL",
                    googleAnalyticsDebugModeEnabled=GOOGLE_ANALYTICS_DEBUG_MODE_ENABLED,
                    googleAnalyticsTrackEventEnable=GOOGLE_ANALYTICS_TRACK_EVENT_ENABLE,
                    googleAnalyticsAddToCartEvent=GOOGLE_ANALYTICS_ADD_TO_CART_EVENT,
                    googleAnalyticsViewItemEvent=GOOGLE_ANALYTICS_VIEW_ITEM_EVENT,
                    googleAnalyticsViewItemListEvent=GOOGLE_ANALYTICS_VIEW_ITEM_LIST_EVENT,
                    googleAnalyticsBeginCheckoutEvent=GOOGLE_ANALYTICS_BEGIN_CHECKOUT_EVENT,
                    googleAnalyticsPurchaseEvent=GOOGLE_ANALYTICS_PURCHASE_EVENT,
                    googleAnalyticsRemoveFromCartEvent=GOOGLE_ANALYTICS_REMOVE_FROM_CART_EVENT,
                    googleAnalyticsViewCartEvent=GOOGLE_ANALYTICS_VIEW_CART_EVENT,
                    googleAnalyticsAddPaymentInfoEvent=GOOGLE_ANALYTICS_ADD_PAYMENT_INFO_EVENT,
                    googleAnalyticsAddShippingInfoEvent=GOOGLE_ANALYTICS_ADD_SHIPPING_INFO_EVENT,
                    facebookPixelEnabled=FACEBOOK_PIXEL_ENABLED,
                    facebookPixelId="FACEBOOK_PIXEL_ID",
                    facebookPixelTrackEventEnable=FACEBOOK_PIXEL_TRACK_EVENT_ENABLE,
                    facebookPixelAddPaymentInfoEvent=FACEBOOK_PIXEL_ADD_PAYMENT_INFO_EVENT,
                    facebookPixelAddToCartEvent=FACEBOOK_PIXEL_ADD_TO_CART_EVENT,
                    facebookPixelInitiateCheckoutEvent=FACEBOOK_PIXEL_INITIATE_CHECKOUT_EVENT,
                    facebookPixelPurchaseEvent=FACEBOOK_PIXEL_PURCHASE_EVENT,
                    facebookPixelSearchEvent=FACEBOOK_PIXEL_SEARCH_EVENT,
                    customCodeUseDefault=CUSTOM_CODE_USE_DEFAULT,
                    isCustomCodeEnableInHeader="CUSTOM_CODE_HEADER_STATUS",
                    customCodeInHeader="CUSTOM_CODE_HEADER",
                    isCustomCodeEnableInFooter="CUSTOM_CODE_FOOTER_STATUS",
                    customCodeInFooter="CUSTOM_CODE_FOOTER"
                ),
                tagName="TAG_NAME",
                tagContent="TAG_CONTENT"
            )
        )
        response = webcommander_sdk.admin_blog.update(id="BLOG_ID", request_data=blog_request_data)
        print(response)
    except WCException as error:
        print(error)
        print(error.get_errors())
        print(error.raw_response)

Response

BlogInfoResponseDTO(
    blog=BlogDataDTO(
        id=BLOG_ID,
        name="BLOG_NAME",
        url="BLOG_URL",
        content="BLOG_CONTENT",
        date="BLOG_DATE",
        isPublished=IS_PUBLISHED,
        visibility="BLOG_VISIBILITY",
        categories=[
            BlogCategoryDTO(id=CATEGORY_ID, name="CATEGORY_NAME", isDisposible=IS_DISPOSABLE, isInTrash=IS_IN_TRASH)
        ],
        createdAt="CREATED_AT",
        isDisposible=IS_DISPOSABLE,
        isInTrash=IS_IN_TRASH,
        image=BlogImageDTO(
            title="IMAGE_TITLE",
            alternativeText="IMAGE_ALT_TEXT",
            fileName="IMAGE_FILE_NAME",
            link="IMAGE_LINK"
        ),
        createdBy=BlogCreatorDTO(id=CREATOR_ID, name="CREATOR_NAME"),
        selectedCustomers=[],
        seoConfigs=[
            BlogSEOConfigDTO(id=SEO_ID_1, value="SEO_VALUE_1", type="SEO_TYPE", configKey="SEO_CONFIG_KEY_1"),
            BlogSEOConfigDTO(id=SEO_ID_2, value="SEO_VALUE_2", type="SEO_TYPE", configKey="SEO_CONFIG_KEY_2"),
            BlogSEOConfigDTO(id=SEO_ID_3, value="SEO_VALUE_3", type="SEO_TYPE", configKey="SEO_CONFIG_KEY_3"),
        ]
    )
)

Creating a Blog Comment

Function: admin_blog_create_comment()

Purpose

This function allows administrators to create a comment on an existing blog post. It enables content managers to engage with their audience by adding comments to blog posts, facilitating discussions, and managing content interaction.

Parameters

ParameterTypeDescription
idstringThe unique identifier of the blog post where the comment will be added.
namestringThe name of the commenter.
emailstringThe email address of the commenter.
contentstringThe text content of the comment.

Use Case

Administrators use this function to add comments on behalf of users or as a part of content moderation. This functionality helps in fostering discussions on blog posts and allows admins to respond to users directly. Comments can later be approved or removed based on moderation policies.

def admin_blog_create_comment():
    webcommander_sdk: WebCommanderSDK = WebCommanderSDK().init_sdk(request_token_dto=CommonData.get_request_token_dto())

    try:
       request_obj = BlogCommentCreateDTO(
            blog=BlogCommentInfoDTO(
                comment=BlogCommentDTO(
                    name="COMMENT_NAME",
                    email="COMMENT_EMAIL",
                    content="COMMENT_CONTENT"
                )
            )
        )
        response = webcommander_sdk.admin_blog.create_comment(id="BLOG_ID", request_data=request_obj)
        print(response)
    except WCException as ab:
        print(ab)
        print(ab.get_errors())
        print(ab.raw_response)

Response

BlogCommentInfoDTO(
    comment=BlogCommentDTO(
        id=COMMENT_ID,
        status="COMMENT_STATUS",
        name="COMMENT_NAME",
        email="COMMENT_EMAIL",
        postTitle="BLOG_POST_TITLE",
        content="COMMENT_CONTENT",
        spam=IS_SPAM,
        likes=TOTAL_LIKES,
        totalReply=TOTAL_REPLIES,
        updatedAt="LAST_UPDATED_TIMESTAMP",
        replies=[]
    ),
    id=BLOG_ID
)

Creating Blog Category

Function: admin_blog_category_create()

Purpose

This function allows administrators to create a new blog category with various attributes, including name, description, content, image, and SEO settings. It also ensures the category is published with proper visibility and tracking configurations. This function is useful for automating blog category creation while ensuring SEO optimization and content categorization.

Parameters

ParameterTypeDescription
namestringThe name of the blog category.
descriptionstringA short description of the blog category.
contentstringThe content associated with the blog category.
datestringThe publication date of the blog category in YYYY-MM-DD HH:MM:SS format.
statusstringThe status of the blog category (e.g., PUBLISHED).
visibilitystringThe visibility of the category (e.g., OPEN).
urlstringThe URL slug for the category.
typestringThe type of category (e.g., page_seo).
imageobjectContains image details such as filename and base64 content.
pageSeoobjectSEO settings including title, description, tracking, and indexing options.
tagNamestringThe tag name associated with the category.
tagContentstringThe content for the tag.

Use Case

Administrators can use this function to create and manage blog categories for their website. By setting SEO configurations and associating appropriate tags, this function helps in improving search engine rankings and ensuring that content is well-organized. It is particularly useful for content management systems that require structured category creation with predefined SEO settings and tracking configurations.

def admin_blog_category_create():
     SDKConfig.PRINT_REQUEST_DATA = True
    SDKConfig.PRINT_RAW_RESPONSE = True

    webcommander_sdk: WebCommanderSDK = WebCommanderSDK().init_sdk(
        request_token_dto=CommonData.get_request_token_dto()
    )

    try:
        blog_request_data = BlogCategoryRequestDTO(
            blogCategory=BlogCategoryCreateDataDTO(
                name="CATEGORY_NAME",
                description="CATEGORY_DESCRIPTION",
                content="CATEGORY_CONTENT",
                date="CATEGORY_DATE",
                status="CATEGORY_STATUS",
                visibility="CATEGORY_VISIBILITY",
                url="CATEGORY_URL",
                type="CATEGORY_TYPE",
                image=BlogImageCreateDTO(
                    fileName="IMAGE_FILE_NAME",
                    base64="IMAGE_BASE64"
                ),
                pageSeo=BlogSEOSettingsDTO(
                    overwiteAutoPageSeo=False,
                    seoTitle="SEO_TITLE",
                    seoDescription="SEO_DESCRIPTION",
                    disableSearchEngineIndex=False,
                    enableCanonicalUrl=True,
                    enableMetaTag=True,
                    analyticsUseDefault=False,
                    trackingEnabled=False,
                    trackingMethod="TRACKING_METHOD",
                    googleAnalyticsEnabled=False,
                    googleAnalytics4="GA4_ID",
                    googleAdsConversionId="GA_CONVERSION_ID",
                    googleAdsConversionLabel="GA_CONVERSION_LABEL",
                    googleAnalyticsDebugModeEnabled=False,
                    googleAnalyticsTrackEventEnable=False,
                    googleAnalyticsAddToCartEvent=False,
                    googleAnalyticsViewItemEvent=False,
                    googleAnalyticsViewItemListEvent=False,
                    googleAnalyticsBeginCheckoutEvent=False,
                    googleAnalyticsPurchaseEvent=False,
                    googleAnalyticsRemoveFromCartEvent=False,
                    googleAnalyticsViewCartEvent=False,
                    googleAnalyticsAddPaymentInfoEvent=False,
                    googleAnalyticsAddShippingInfoEvent=False,
                    facebookPixelEnabled=False,
                    facebookPixelId="FB_PIXEL_ID",
                    facebookPixelTrackEventEnable=False,
                    facebookPixelAddPaymentInfoEvent=False,
                    facebookPixelAddToCartEvent=False,
                    facebookPixelInitiateCheckoutEvent=False,
                    facebookPixelPurchaseEvent=False,
                    facebookPixelSearchEvent=False,
                    customCodeUseDefault=False,
                    isCustomCodeEnableInHeader="off",
                    customCodeInHeader="",
                    isCustomCodeEnableInFooter="off",
                    customCodeInFooter=""
                ),
                tagName="CATEGORY_TAG_NAME",
                tagContent="CATEGORY_TAG_CONTENT"
            )
        )

        response = webcommander_sdk.admin_blog.create_blog_category(request_data=blog_request_data)
        print(response)

    except WCException as ex:
        print(ex)
        print(ex.get_errors())
        print(ex.raw_response)

Response

BlogCategoriesInfoDTO(
    blogCategory=BlogCategoryDataDTO(
        id=31,
        name='CATEGORY_NAME',
        url='CATEGORY_URL',
        description='CATEGORY_DESCRIPTION',
        isDisposible=False,
        isInTrash=False,
        createdAt='CATEGORY_CREATED_AT',
        updatedAt='CATEGORY_UPDATED_AT',
        image=BlogImageDTO(
            title=None,
            alternativeText=None,
            fileName='IMAGE_FILE_NAME',
            link='IMAGE_LINK'
        ),
        seoConfigs=[
            BlogSEOConfigDTO(id=4372, value='off', type='page_seo', configKey='is_custom_code_enable_in_header'),
            BlogSEOConfigDTO(id=4375, value='false', type='page_seo', configKey='facebook_pixel_initiate_checkout_event'),
            BlogSEOConfigDTO(id=4378, value='false', type='page_seo', configKey='google_analytics_enabled'),
            BlogSEOConfigDTO(id=4381, value='false', type='page_seo', configKey='overwite_auto_page_seo'),
            BlogSEOConfigDTO(id=4384, value=None, type='page_seo', configKey='google_ads_conversion_id'),
            BlogSEOConfigDTO(id=4387, value='false', type='page_seo', configKey='google_analytics_view_item_event'),
            BlogSEOConfigDTO(id=4390, value='false', type='page_seo', configKey='google_analytics_view_cart_event'),
            BlogSEOConfigDTO(id=4393, value='false', type='page_seo', configKey='facebook_pixel_purchase_event'),
            BlogSEOConfigDTO(id=4396, value=None, type='page_seo', configKey='google_ads_conversion_label'),
            BlogSEOConfigDTO(id=4399, value='true', type='page_seo', configKey='enable_meta_tag'),
            BlogSEOConfigDTO(id=4402, value='false', type='page_seo', configKey='google_analytics_debug_mode_enabled'),
            BlogSEOConfigDTO(id=4405, value='false', type='page_seo', configKey='google_analytics_add_shipping_info_event'),
            BlogSEOConfigDTO(id=4408, value='false', type='page_seo', configKey='custom_code_use_default'),
            BlogSEOConfigDTO(id=4411, value='SEO_DESCRIPTION', type='page_seo', configKey='seo_description'),
            BlogSEOConfigDTO(id=4414, value='false', type='page_seo', configKey='facebook_pixel_add_payment_info_event'),
            BlogSEOConfigDTO(id=4417, value=None, type='page_seo', configKey='google_analytics4'),
            BlogSEOConfigDTO(id=4420, value='google-analytics', type='page_seo', configKey='tracking_method'),
            BlogSEOConfigDTO(id=4423, value='false', type='page_seo', configKey='facebook_pixel_track_event_enable'),
            BlogSEOConfigDTO(id=4426, value='false', type='page_seo', configKey='facebook_pixel_add_to_cart_event'),
            BlogSEOConfigDTO(id=4429, value='false', type='page_seo', configKey='google_analytics_view_item_list_event'),
            BlogSEOConfigDTO(id=4432, value='false', type='page_seo', configKey='google_analytics_begin_checkout_event'),
            BlogSEOConfigDTO(id=4435, value='true', type='page_seo', configKey='enable_canonical_url'),
            BlogSEOConfigDTO(id=4438, value='false', type='page_seo', configKey='facebook_pixel_enabled'),
            BlogSEOConfigDTO(id=4441, value='SEO_TITLE', type='page_seo', configKey='seo_title'),
            BlogSEOConfigDTO(id=4444, value='false', type='page_seo', configKey='google_analytics_remove_from_cart_event'),
            BlogSEOConfigDTO(id=4447, value='false', type='page_seo', configKey='google_analytics_track_event_enable'),
            BlogSEOConfigDTO(id=4450, value=None, type='page_seo', configKey='custom_code_in_footer'),
            BlogSEOConfigDTO(id=4453, value='false', type='page_seo', configKey='google_analytics_purchase_event'),
            BlogSEOConfigDTO(id=4456, value=None, type='page_seo', configKey='facebook_pixel_id'),
            BlogSEOConfigDTO(id=4459, value='false', type='page_seo', configKey='facebook_pixel_search_event'),
            BlogSEOConfigDTO(id=4462, value=None, type='page_seo', configKey='custom_code_in_header'),
            BlogSEOConfigDTO(id=4465, value='off', type='page_seo', configKey='is_custom_code_enable_in_footer'),
            BlogSEOConfigDTO(id=4468, value='false', type='page_seo', configKey='analytics_use_default'),
            BlogSEOConfigDTO(id=4471, value='false', type='page_seo', configKey='google_analytics_add_payment_info_event'),
            BlogSEOConfigDTO(id=4474, value='false', type='page_seo', configKey='disable_search_engine_index'),
            BlogSEOConfigDTO(id=4477, value='false', type='page_seo', configKey='tracking_enabled'),
            BlogSEOConfigDTO(id=4480, value='false', type='page_seo', configKey='google_analytics_add_to_cart_event')
        ]
    )
)

Getting Blog Categories

Function: admin_blog_category_list()

Purpose

This function retrieves a list of all available blog categories, including their SEO configurations, associated image details, and pagination information. It is useful for administrators to get an overview of the existing categories and their associated metadata.

Parameters

ParameterTypeDescription
limitstrThe number of categories to retrieve per page. If not specified, it fetches the default amount.
offsetintThe starting point for fetching categories. Useful for pagination, specifies the index to begin.
directionstrThe direction to sort the categories.
order_bystrThe field by which to sort the categories

Use Case

This function can be used to fetch the current list of blog categories, which may be displayed in an admin interface. It is helpful for administrators to review and manage the categories or retrieve metadata associated with them, such as SEO settings and image details.

def admin_blog_category_list(limit: str = None, offset: int = None, direction: SortDirection = None, order_by: str = None):
    SDKConfig.PRINT_REQUEST_DATA = True
    SDKConfig.PRINT_RAW_RESPONSE = True
    webcommander_sdk: WebCommanderSDK = WebCommanderSDK().init_sdk(request_token_dto=CommonData.get_request_token_dto())

    try:
        response = webcommander_sdk.admin_blog.categories_list(
            limit=limit,
            offset=offset,
            direction=direction,
            order_by=order_by
        )
        print(response)
    except WCException as ab:
        print(ab)
        print(ab.get_errors())
        print(ab.raw_response)

Response

BlogCategoriesListDTO(
    blogCategories=[
        BlogCategoryDataDTO(
            id='CATEGORY_ID'
            name='CATEGORY_NAME',
            url='CATEGORY_URL',
            description='CATEGORY_DESCRIPTION',
            isDisposible=False,
            isInTrash=False,
            createdAt='CATEGORY_CREATED_AT',
            updatedAt='CATEGORY_UPDATED_AT',
            image=BlogImageDTO(
                title=None,
                alternativeText=None,
                fileName='IMAGE_FILE_NAME',
                link='IMAGE_LINK'
            ),
            seoConfigs=[
                BlogSEOConfigDTO(id='SEO_CONFIG_ID_1', value='off', type='page_seo', configKey='is_custom_code_enable_in_header'),
                BlogSEOConfigDTO(id='SEO_CONFIG_ID_2', value='false', type='page_seo', configKey='facebook_pixel_initiate_checkout_event'),
                BlogSEOConfigDTO(id='SEO_CONFIG_ID_3', value='false', type='page_seo', configKey='google_analytics_enabled'),
                BlogSEOConfigDTO(id='SEO_CONFIG_ID_4', value='false', type='page_seo', configKey='overwite_auto_page_seo'),
                BlogSEOConfigDTO(id='SEO_CONFIG_ID_5', value=None, type='page_seo', configKey='google_ads_conversion_id'),
                BlogSEOConfigDTO(id='SEO_CONFIG_ID_6', value='false', type='page_seo', configKey='google_analytics_view_item_event'),
                BlogSEOConfigDTO(id='SEO_CONFIG_ID_7', value='false', type='page_seo', configKey='google_analytics_view_cart_event'),
                BlogSEOConfigDTO(id='SEO_CONFIG_ID_8', value='false', type='page_seo', configKey='facebook_pixel_purchase_event'),
                BlogSEOConfigDTO(id='SEO_CONFIG_ID_9', value=None, type='page_seo', configKey='google_ads_conversion_label'),
                BlogSEOConfigDTO(id='SEO_CONFIG_ID_10', value='true', type='page_seo', configKey='enable_meta_tag'),
                BlogSEOConfigDTO(id='SEO_CONFIG_ID_11', value='false', type='page_seo', configKey='google_analytics_debug_mode_enabled'),
                BlogSEOConfigDTO(id='SEO_CONFIG_ID_12', value='false', type='page_seo', configKey='google_analytics_add_shipping_info_event'),
                BlogSEOConfigDTO(id='SEO_CONFIG_ID_13', value='false', type='page_seo', configKey='custom_code_use_default'),
                BlogSEOConfigDTO(id='SEO_CONFIG_ID_14', value='SEO_DESCRIPTION', type='page_seo', configKey='seo_description'),
                BlogSEOConfigDTO(id='SEO_CONFIG_ID_15', value=None, type='page_seo', configKey='google_analytics4'),
                BlogSEOConfigDTO(id='SEO_CONFIG_ID_16', value='false', type='page_seo', configKey='facebook_pixel_add_payment_info_event'),
                BlogSEOConfigDTO(id='SEO_CONFIG_ID_17', value='google-analytics', type='page_seo', configKey='tracking_method'),
                BlogSEOConfigDTO(id='SEO_CONFIG_ID_18', value='false', type='page_seo', configKey='facebook_pixel_track_event_enable'),
                BlogSEOConfigDTO(id='SEO_CONFIG_ID_19', value='false', type='page_seo', configKey='facebook_pixel_add_to_cart_event'),
                BlogSEOConfigDTO(id='SEO_CONFIG_ID_20', value='false', type='page_seo', configKey='google_analytics_view_item_list_event'),
                BlogSEOConfigDTO(id='SEO_CONFIG_ID_21', value='false', type='page_seo', configKey='google_analytics_begin_checkout_event'),
                BlogSEOConfigDTO(id='SEO_CONFIG_ID_22', value='true', type='page_seo', configKey='enable_canonical_url'),
                BlogSEOConfigDTO(id='SEO_CONFIG_ID_23', value='false', type='page_seo', configKey='facebook_pixel_enabled'),
                BlogSEOConfigDTO(id='SEO_CONFIG_ID_24', value='SEO_TITLE', type='page_seo', configKey='seo_title'),
                BlogSEOConfigDTO(id='SEO_CONFIG_ID_25', value='false', type='page_seo', configKey='google_analytics_remove_from_cart_event'),
                BlogSEOConfigDTO(id='SEO_CONFIG_ID_26', value='false', type='page_seo', configKey='google_analytics_track_event_enable'),
                BlogSEOConfigDTO(id='SEO_CONFIG_ID_27', value=None, type='page_seo', configKey='custom_code_in_footer'),
                BlogSEOConfigDTO(id='SEO_CONFIG_ID_28', value='false', type='page_seo', configKey='google_analytics_purchase_event'),
                BlogSEOConfigDTO(id='SEO_CONFIG_ID_29', value=None, type='page_seo', configKey='facebook_pixel_id'),
                BlogSEOConfigDTO(id='SEO_CONFIG_ID_30', value='false', type='page_seo', configKey='facebook_pixel_search_event'),
                BlogSEOConfigDTO(id='SEO_CONFIG_ID_31', value=None, type='page_seo', configKey='custom_code_in_header'),
                BlogSEOConfigDTO(id='SEO_CONFIG_ID_32', value='off', type='page_seo', configKey='is_custom_code_enable_in_footer'),
                BlogSEOConfigDTO(id='SEO_CONFIG_ID_33', value='false', type='page_seo', configKey='analytics_use_default'),
                BlogSEOConfigDTO(id='SEO_CONFIG_ID_34', value='false', type='page_seo', configKey='google_analytics_add_payment_info_event'),
                BlogSEOConfigDTO(id='SEO_CONFIG_ID_35', value='false', type='page_seo', configKey='disable_search_engine_index'),
                BlogSEOConfigDTO(id='SEO_CONFIG_ID_36', value='false', type='page_seo', configKey='tracking_enabled'),
                BlogSEOConfigDTO(id='SEO_CONFIG_ID_37', value='false', type='page_seo', configKey='google_analytics_add_to_cart_event')
            ]
        )
    ],
    pagination=PaginationDTO(
        records='RECORDS_COUNT',  # Placeholder for records
        limit='PAGE_LIMIT',  # Placeholder for page limit
        offset='PAGE_OFFSET',  # Placeholder for page offset
        nextPage='NEXT_PAGE_URL',  # Placeholder for next page URL
        previousPage='PREVIOUS_PAGE_URL'  # Placeholder for previous page URL
    )
)

Getting Specific Category Info

Function: admin_blog_category_info()

Purpose

This function retrieves the details of a specific blog category from the WebCommander API based on the provided category id.

Parameters

ParameterTypeDescription
idstrThe unique identifier of the blog category to retrieve. This is a required parameter.

Use Case

This function is useful when you need to fetch detailed information about a specific blog category. For example, if you want to view or edit a particular category’s details on the admin dashboard.

def admin_blog_category_info(id: str):
    SDKConfig.PRINT_REQUEST_DATA = True
    SDKConfig.PRINT_RAW_RESPONSE = True
    webcommander_sdk: WebCommanderSDK = WebCommanderSDK().init_sdk(request_token_dto=CommonData.get_request_token_dto())

    try:
        response = webcommander_sdk.admin_blog.category_info(id=id)
        print(response)
    except WCException as ab:
        print(ab)
        print(ab.get_errors())
        print(ab.raw_response)

Response

BlogCategoriesInfoDTO(
    blogCategory=BlogCategoryDataDTO(
        id='CATEGORY_ID', 
        name='CATEGORY_NAME',
        url='CATEGORY_URL',
        description='CATEGORY_DESCRIPTION',
        isDisposible=False,
        isInTrash=False,
        createdAt='CATEGORY_CREATED_AT',
        updatedAt='CATEGORY_UPDATED_AT',
        image=BlogImageDTO(
            title=None,
            alternativeText=None,
            fileName='IMAGE_FILE_NAME',
            link='IMAGE_LINK'
        ),
        seoConfigs=[
            BlogSEOConfigDTO(id='SEO_CONFIG_ID_1', value='off', type='page_seo', configKey='is_custom_code_enable_in_header'),
            BlogSEOConfigDTO(id='SEO_CONFIG_ID_2', value='false', type='page_seo', configKey='facebook_pixel_initiate_checkout_event'),
            BlogSEOConfigDTO(id='SEO_CONFIG_ID_3', value='false', type='page_seo', configKey='google_analytics_enabled'),
            BlogSEOConfigDTO(id='SEO_CONFIG_ID_4', value='false', type='page_seo', configKey='overwite_auto_page_seo'),
            BlogSEOConfigDTO(id='SEO_CONFIG_ID_5', value=None, type='page_seo', configKey='google_ads_conversion_id'),
            BlogSEOConfigDTO(id='SEO_CONFIG_ID_6', value='false', type='page_seo', configKey='google_analytics_view_item_event'),
            BlogSEOConfigDTO(id='SEO_CONFIG_ID_7', value='false', type='page_seo', configKey='google_analytics_view_cart_event'),
            BlogSEOConfigDTO(id='SEO_CONFIG_ID_8', value='false', type='page_seo', configKey='facebook_pixel_purchase_event'),
            BlogSEOConfigDTO(id='SEO_CONFIG_ID_9', value=None, type='page_seo', configKey='google_ads_conversion_label'),
            BlogSEOConfigDTO(id='SEO_CONFIG_ID_10', value='true', type='page_seo', configKey='enable_meta_tag'),
            BlogSEOConfigDTO(id='SEO_CONFIG_ID_11', value='false', type='page_seo', configKey='google_analytics_debug_mode_enabled'),
            BlogSEOConfigDTO(id='SEO_CONFIG_ID_12', value='false', type='page_seo', configKey='google_analytics_add_shipping_info_event'),
            BlogSEOConfigDTO(id='SEO_CONFIG_ID_13', value='false', type='page_seo', configKey='custom_code_use_default'),
            BlogSEOConfigDTO(id='SEO_CONFIG_ID_14', value='SEO_DESCRIPTION', type='page_seo', configKey='seo_description'),
            BlogSEOConfigDTO(id='SEO_CONFIG_ID_15', value=None, type='page_seo', configKey='google_analytics4'),
            BlogSEOConfigDTO(id='SEO_CONFIG_ID_16', value='false', type='page_seo', configKey='facebook_pixel_add_payment_info_event'),
            BlogSEOConfigDTO(id='SEO_CONFIG_ID_17', value='google-analytics', type='page_seo', configKey='tracking_method'),
            BlogSEOConfigDTO(id='SEO_CONFIG_ID_18', value='false', type='page_seo', configKey='facebook_pixel_track_event_enable'),
            BlogSEOConfigDTO(id='SEO_CONFIG_ID_19', value='false', type='page_seo', configKey='facebook_pixel_add_to_cart_event'),
            BlogSEOConfigDTO(id='SEO_CONFIG_ID_20', value='false', type='page_seo', configKey='google_analytics_view_item_list_event'),
            BlogSEOConfigDTO(id='SEO_CONFIG_ID_21', value='false', type='page_seo', configKey='google_analytics_begin_checkout_event'),
            BlogSEOConfigDTO(id='SEO_CONFIG_ID_22', value='true', type='page_seo', configKey='enable_canonical_url'),
            BlogSEOConfigDTO(id='SEO_CONFIG_ID_23', value='false', type='page_seo', configKey='facebook_pixel_enabled'),
            BlogSEOConfigDTO(id='SEO_CONFIG_ID_24', value='SEO_TITLE', type='page_seo', configKey='seo_title'),
            BlogSEOConfigDTO(id='SEO_CONFIG_ID_25', value='false', type='page_seo', configKey='google_analytics_remove_from_cart_event'),
            BlogSEOConfigDTO(id='SEO_CONFIG_ID_26', value='false', type='page_seo', configKey='google_analytics_track_event_enable'),
            BlogSEOConfigDTO(id='SEO_CONFIG_ID_27', value=None, type='page_seo', configKey='custom_code_in_footer'),
            BlogSEOConfigDTO(id='SEO_CONFIG_ID_28', value='false', type='page_seo', configKey='google_analytics_purchase_event'),
            BlogSEOConfigDTO(id='SEO_CONFIG_ID_29', value=None, type='page_seo', configKey='facebook_pixel_id'),
            BlogSEOConfigDTO(id='SEO_CONFIG_ID_30', value='false', type='page_seo', configKey='facebook_pixel_search_event'),
            BlogSEOConfigDTO(id='SEO_CONFIG_ID_31', value=None, type='page_seo', configKey='custom_code_in_header'),
            BlogSEOConfigDTO(id='SEO_CONFIG_ID_32', value='off', type='page_seo', configKey='is_custom_code_enable_in_footer'),
            BlogSEOConfigDTO(id='SEO_CONFIG_ID_33', value='false', type='page_seo', configKey='analytics_use_default'),
            BlogSEOConfigDTO(id='SEO_CONFIG_ID_34', value='false', type='page_seo', configKey='google_analytics_add_payment_info_event'),
            BlogSEOConfigDTO(id='SEO_CONFIG_ID_35', value='false', type='page_seo', configKey='disable_search_engine_index'),
            BlogSEOConfigDTO(id='SEO_CONFIG_ID_36', value='false', type='page_seo', configKey='tracking_enabled'),
            BlogSEOConfigDTO(id='SEO_CONFIG_ID_37', value='false', type='page_seo', configKey='google_analytics_add_to_cart_event')
        ]
    )
)