Blog Image Id is retrieving differently via headless API

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.
¿Fue útil este artículo?
Usuarios a los que les pareció útil: 0 de 0