Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Jonas 1 post 71 karma points
    Jun 19, 2024 @ 22:39
    Jonas
    0

    Delivery API - Block list

    Is it possible to get all the items from blocks in the request?

    I only want the items inside the Block List blockNewsList

    http://localhost:5001/umbraco/delivery/api/v2/content?filter=contentType%3AnewsOverviewPage&skip=0&take=10&fields=properties%5B%24all%5D

    For example:

    {
      "total": 1,
      "items": [
        {
          "contentType": "newsOverviewPage",
          "name": "News",
          "createDate": "2024-06-19T23:00:44.25Z",
          "updateDate": "2024-06-19T23:26:30.833Z",
          "route": {
            "path": "/news",
            "startItem": {
              "id": "064b2a17-e2d2-4e75-b02e-e1c2b4fa5752",
              "path": "home-page"
            }
          },
          "id": "c57f7b2c-237d-492f-a707-6c5010de1936",
          "properties": {
            "socialTitle": null,
            "socialDescription": null,
            "socialImage": [],
            "metaTitle": null,
            "metaDescription": null,
            "metaAllowIndexing": true,
            "metaAllowFollowing": true,
            "hideFromSitemap": false,
            "blocks": {
              "items": [
                {
                  "content": {
                    "contentType": "blockNewsList",
                    "id": "ef20dedd-fe96-45c6-b8b8-817846481fa5",
                    "properties": {
                      "news": {
                        "items": [
                          {
                            "content": {
                              "contentType": "blockNewsListNestedArticle",
                              "id": "74db12e8-a565-409e-9f40-e5e6836bdce1",
                              "properties": {
                                "tag": {
                                  "name": "Dummy Tag 1",
                                  "url": "/site-settings/news-tags/dummy-tag-1"
                                },
                                "heading": "Dummy Heading 1",
                                "isMemberRequired": false,
                                "media": [
                                  {
                                    "id": 1327,
                                    "name": "Dummy Image 1",
                                    "url": "/media/dummy/img-1.jpg",
                                    "height": "2560",
                                    "width": "3840",
                                    "extention": "jpg",
                                    "crops": [],
                                    "focalPoint": null,
                                    "altText": "Dummy Alt Text 1",
                                    "copyright": "Dummy Copyright 1"
                                  }
                                ],
                                "alternative": null
                              }
                            },
                            "settings": null
                          },
                          {
                            "content": {
                              "contentType": "blockNewsListNestedArticle",
                              "id": "b8cfc1a9-c7d2-465e-96bc-059aa1a1501c",
                              "properties": {
                                "tag": {
                                  "name": "Dummy Tag 2",
                                  "url": "/site-settings/news-tags/dummy-tag-2"
                                },
                                "heading": "Dummy Heading 2",
                                "isMemberRequired": false,
                                "media": [
                                  {
                                    "id": 1326,
                                    "name": "Dummy Image 2",
                                    "url": "/media/dummy/img-2.jpg",
                                    "height": "1574",
                                    "width": "2351",
                                    "extention": "jpg",
                                    "crops": [],
                                    "focalPoint": null,
                                    "altText": "Dummy Alt Text 2",
                                    "copyright": "Dummy Copyright 2"
                                  }
                                ],
                                "alternative": null
                              }
                            },
                            "settings": null
                          }
                        ]
                      }
                    }
                  },
                  "settings": {
                    "contentType": "blockNewsListSettings",
                    "id": "380f09f0-1216-41b2-8dd6-bd26a90ae68a",
                    "properties": {}
                  }
                }
              ]
            }
          },
          "cultures": {}
        }
      ]
    }
    
  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies