Get request image url

Hello,

I am trying to make a simple GET request to a local headless cms (strapi). In principle the request works, I get information about the title etc. what I don’t get is the url of the images that are in the article. I tried ‘popualte=*’, but then I only get the info that there is a linked media file in the blocks.

“blocks”: [
{
“__component”: “shared.media”,
“id”: 29
},

How do I get the url of the images?

Best regards
Jens

Hey @cryosat-geoscienti33 :waving_hand:

Welcome to the Postman Community! :postman:

Is this a public API that has documentation that could be shared?

Without know the API and how it’s been implemented, it’s difficult for anyone to know what filters/parameters/etc are available on the endpoints.

Hello Danny,

thanks, Strapi is an open-source CMS, I found this in the documentation.

Does that help?

Many thanks and best regards
Jens

Hey @cryosat-geoscienti33,

Can you please try the following GET request?

/api/articles?populate[blocks][populate]=media

It should return full media info, including image URLs.

Unfortunately it does not work, I get this error message:

{
    "data": null,
    "error": {
        "status": 500,
        "name": "InternalServerError",
        "message": "Internal Server Error"
    }
}

When I access a single article with its ID I get the answer

/api/articles/msyhpknnmyjgj4jf3lim7p0q?populate=blocks

{
    "data": {
        "id": 30,
        "documentId": "msyhpknnmyjgj4jf3lim7p0q",
        "title": "Artikel 01",
        "description": "Das ist ein Artikel",
        "slug": "beautiful-picture",
        "createdAt": "2025-07-11T09:25:02.448Z",
        "updatedAt": "2025-07-11T12:35:17.398Z",
        "publishedAt": "2025-07-11T12:35:17.426Z",
        "blocks": [
            {
                "__component": "shared.media",
                "id": 29
            },
            {
                "__component": "shared.media",
                "id": 30
            },
            {
                "__component": "shared.rich-text",
                "id": 27,
                "body": "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet."
            },
            {
                "__component": "shared.media",
                "id": 31
            }
        ]
    },
    "meta": {}
}

The 500 error might be due to some misconfigured component. You can continue by getting a single article using it’s ID:

/api/articles/{article_id}?populate[blocks][populate]=media

unfortunately does not work either, i get this error message in cmd:

[2025-07-17 13:11:39.548] error: Invalid nested population query detected. When using ‘populate’ within polymorphic structures, its value must be ‘*’

to indicate all second level links. Specific field targeting is not supported here. Consider using the fragment API for more granular population control.

Error: Invalid nested population query detected. When using ‘populate’ within polymorphic structures, its value must be ‘*’ to indicate all second level links.

Specific field targeting is not supported here. Consider using the fragment API for more granular population control.

at C:\xampp\htdocs\strapi-custum-api-endpoint\node_modules\@strapi\utils\dist\convert-query-params.js:220:27
at Array.reduce (<anonymous>)
at convertPopulateObject (C:\xampp\htdocs\strapi-custum-api-endpoint\node_modules\@strapi\utils\dist\convert-query-params.js:176:41)
at convertPopulateQueryParams (C:\xampp\htdocs\strapi-custum-api-endpoint\node_modules\@strapi\utils\dist\convert-query-params.js:161:20)
at Object.transformQueryParams [as transform] (C:\xampp\htdocs\strapi-custum-api-endpoint\node_modules\@strapi\utils\dist\convert-query-params.js:480:30)
at Array.<anonymous> (C:\xampp\htdocs\strapi-custum-api-endpoint\node_modules\@strapi\core\dist\services\document-service\transform\query.js:6:46)
at Array.l (C:\xampp\htdocs\strapi-custum-api-endpoint\node_modules\lodash\lodash.min.js:58:213)
at C:\xampp\htdocs\strapi-custum-api-endpoint\node_modules\@strapi\utils\dist\async.js:11:34
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
at async findOne (C:\xampp\htdocs\strapi-custum-api-endpoint\node_modules\@strapi\core\dist\services\document-service\repository.js:78:25)

[2025-07-17 13:11:39.549] http: GET /api/articles/msyhpknnmyjgj4jf3lim7p0q?populate[blocks][populate]=media (7 ms) 500