Display Singular Post content with Elemntor Template Library in REST API

I have Created A Single Page Template in this I have added a feature image widget, Post title widget, social media widget, and post content image and I applied that template to all post. now I have the REST API in which I am using [elementor-template id=”‘.$post_id.'”] shortcode to get the particular blog page as HTML. now I can get post content but not able to get other widgets like feature image widget, Post title widget, and social media widget. Please if you guys can help me to solve this. below is the code

<?php
function get_blog_post_html_test( $request ) {
    
    $permalink = $request->get_param( 'slug' );

    $args = [
        'post_type'      => 'post',
        'posts_per_page' => 1,
        'post_name__in'  => [$permalink],
        'fields'         => 'ids' 
    ];
    
    $posts = get_posts( $args );
    
    $post_id = $posts[0];
    $post = get_post($post_id);
    
    
    if (!$post || $post->post_type !== 'post') {
        wp_send_json_error( 'Resource not found', 404 );
        
    }

    
    // Make sure Elementor is loaded
    if (class_exists('ElementorPlugin')) {
        
        // Get the Elementor instance
        $elementor = ElementorPlugin::instance();
        
        // Get the post content (main content)
        $content = get_the_content($post_id);
        $header_content = get_raw_header($post_id);
        $footer_content = get_raw_footer($post_id);
        
        // Create a DOMDocument
        $dom = new DOMDocument;
        $dom->loadHTML('<?xml encoding="UTF-8">' .$content);
        
        // Create a DOMXPath
        $xpath = new DOMXPath($dom);
        
        // Find elements with class 'elementor-widget-video'
        $videoElements = $xpath->query("//*[contains(concat(' ', normalize-space(@class), ' '), 'elementor-widget-video')]");
        
        // Iterate through the video elements
        foreach ($videoElements as $videoElement) {
            // Extract the 'data-settings' attribute value
            $dataSettingsValue = $videoElement->getAttribute('data-settings');
            
            // Decode the JSON string into a PHP object
            $dataObject = json_decode($dataSettingsValue);
            if ('youtube' === $dataObject->video_type) {
                $video_url = $dataObject->youtube_url;
                // Parse the URL to get the query string
                $urlParts = parse_url($video_url);
                parse_str($urlParts['query'], $queryParameters);

                // Check if 'v' parameter exists
                if (isset($queryParameters['v'])) {
                    $videoId = $queryParameters['v'];
                    $youtubeUrl = "https://www.youtube.com/embed/{$videoId}";

                    // Assuming 'iframeCode' contains the iframe HTML code you want to add
                    $iframeCode = "<iframe class='elementor-video' frameborder='0' allowfullscreen='' allow='accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share' width='640' height='360' src='{$youtubeUrl}?controls=1&rel=0&playsinline=0'></iframe>";

                    // Find the parent div with class 'elementor-video'
                    $parentDiv = $xpath->query("//*[contains(concat(' ', normalize-space(@class), ' '), 'elementor-video')]", $videoElement)->item(0);

                    // Create a DOMDocumentFragment for the iframe code
                    $fragment = $dom->createDocumentFragment();
                    $fragment->appendXML($iframeCode);

                    // Import the iframe fragment to the main document
                    $importedFragment = $dom->importNode($fragment, true);

                    // Add the iframe under the div
                    $parentDiv->appendChild($importedFragment);
                }
            
            }
        }
        // Updated HTML
        $updatedHtml = $dom->saveHTML();
        
        $src_info = 'blog-details elementor-kit-10 elementor-page elementor-page-'.$post_id;
        

        // Create an array with content
        $response = array(
            //'seo_information' => $seoData,
            'classes' => $src_info,
            //'content_html' => json_decode(get_post_meta( $post_id, '_elementor_data', true )),
            'content_html' => do_shortcode('[elementor-template id="'.$post_id.'"]')
            //'content_html' => get_full_elementor_content_with_assets($post_id)

            //'footer_html' => $footer_content,
        );

    
        echo json_encode(array('statusCode'=>200,'message'=>'Blog Detail','result'=>$response));
    }
    
    //return new WP_REST_Response( $html_content, 200 );
}

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật