Legacy Knowledge Base
Published Jun. 30, 2025

Blog Image Id is retrieving differently via headless API

Written By

Pooja Bhambani

How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!

While we make every effort to ensure this Knowledge Base is accurate, it may not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with any feedback or concerns.

Legacy Article

You are viewing an article from our legacy "FastTrack" publication program, made available for informational purposes. Articles in this program were published without a requirement for independent editing or verification and are provided"as is" without guarantee.

Before using any information from this article, independently verify its suitability for your situation and project.

Issue

  • Steps to reproduce:
    1. Start Liferay DXP 7.4.
    2. Navigate to Content & Data > Blogs.
    3. Create one blog.
    4. Now, navigate to localhost:8080/o/api.
    5. Execute this request under BlogPostingImage:
    Get /v1.0/sites/{site-id}/blog-postings-images

    After executing this request, you'll receive the following response body: Note the "id".

    { 
    "contentUrl": "/documents/34933/34935/Import.png/5a907d7d-df27-c701-5b08-8460e3daecdd?version=1.0&t=1688469903434",
    "encodingFormat": "image/png",
    "fileExtension": "png",
    "id": 34936,
    "sizeInBytes": 42586,
    "title": "Import.png"
    }
    6. Now, execute this request:
    Get /v1.0/sites/{site-id}/blog-postings under headless-delivery/v1.0

    After executing this request, you'll receive the following response body: Note the "image-id".

    "image": { 
    "caption": "<p>Caption</p>",
    "contentUrl": "/documents/d/guest/import-png-1",
    "imageId": 34950
    },
    Actual Result: The blog image id is retrieved differently in steps 5 and step 6.
    Expected Result: The blog image id must be the same by fetching the blog contents from the following APIs:
    Get /v1.0/sites/{site-id}/blog-posting-images.
    Get /v1.0/sites/{site-id}/blog-postings under headless-delivery/v1.0.

Environment

  • Liferay DXP 7.4

Resolution

  • The 'id' and 'imageid' retrieval via headless API is the expected behavior of the product. The reason behind this is that in the following APIs, we're retrieving the different elements:
    Get /v1.0/sites/{site-id}/blog-posting-images
    Get /v1.0/sites/{site-id}/blog-postings 
  • Regarding (Get /v1.0/sites/{site-id}/blog-posting-images) request:
    • The blog-posting-images request will show a list of the images uploaded to the blog's repository, which means All the ORIGINAL Images sent to the BLOGS repository. 
    • In this case, the id is the ID of the files that could be seen in the Images tab of the Blogs portlet.
    • Users can also verify this by checking the filentryid column of the dlfilentry table.
  • Regarding (Get /v1.0/sites/{site-id}/blog-postings) request:
    • The blog-posting shows a list of blog entries.
    • In this case, the image id is the id of the image used as the Cover Image of each blog entry. It is a cropped copy of the original Image updated to the BLOGS repository.
    • Users can also verify this by checking the coverimagefileentryid column of the blogsentrytable.
Did this article resolve your issue ?

Legacy Knowledge Base