Request

Response

    Retrieve Items by Project or Folder

    This topic provides instructions on how to retrieve the following objects:

    • Items within a project.
    • Items within a folder.

    You will use the following query in this topic:

    TypeOperationDescription
    Query itemsByProject Retrieves Items within a project.
    Query itemsByFolder Retrieves Items within a folder.

    Step 1 - Retrieve Items within a Project

    The following steps demonstrate how you can run the itemsByProject query to retrieve all the Items within a project.

    1. Enter the following query in the Query Pane of the Manufacturing Data Model Explorer.

      Query

      query GetFolderItemsByProject($projectId: ID!) {
        itemsByProject(projectId: $projectId) {
            results {
              __typename
              id
              name
              ... on DesignItem {
                id
                name
                rootComponent {
                  id
                  name
                }
                tipRootComponentVersion {
                  id
                  name
                }
              }
            }
          }
        }
      
      Show More
    2. In the Query Variables Pane, enter the value of the projectId. To know how to obtain the projectId, refer to Retrieve Projects.

      Query Variables

      {
        "projectId": "urn:adsk.workspace:prod.project:1e5ae8b2-81c3-458c-861c-7f5e64856efd"
      }
      
    3. Click Play. A list of Items within a project is displayed in the response.

      Response

      {
        "data": {
          "itemsByProject": {
            "results": [
              {
                "__typename": "DesignItem",
                "id": "urn:adsk.wipprod:dm.lineage:34079Vg4TfiHXR4d3-fRyg",
                "name": "Noemie's Box",
                "rootComponent": {
                  "id": "Y29tcH5jby5uckdoR0ZIb1FXU3NQdFlhU0V2YThnfjVEcWcwOTQ0U3VjYmJlSjc5SVE5TVVfYWdh",
                  "name": "Noemie's Box"
                },
                "tipRootComponentVersion": {
                  "id": "Y29tcH5jby5uckdoR0ZIb1FXU3NQdFlhU0V2YThnfjVEcWcwOTQ0U3VjYmJlSjc5SVE5TVVfYWdhflRwWXVZZlZvbTB4RlNRYW1ISFhnemE",
                  "name": "Noemie's Box"
                }
              },
              {
                "__typename": "DesignItem",
                "id": "urn:adsk.wipprod:dm.lineage:6zBqHkbKRF-nP8FxVbEKAQ",
                "name": "ConfigurationMemberFunctionalTest",
                "rootComponent": {
                  "id": "Y29tcH5jby5uckdoR0ZIb1FXU3NQdFlhU0V2YThnfnBxcm82TFEzc05uNjlrMEJyTDlwNWpfYWdh",
                  "name": "ConfigurationMemberFunctionalTest"
                },
                "tipRootComponentVersion": {
                  "id": "Y29tcH5jby5uckdoR0ZIb1FXU3NQdFlhU0V2YThnfnBxcm82TFEzc05uNjlrMEJyTDlwNWpfYWdhfkpiVFFxRWp2V2NiMDZra3JkU3A2ZFk",
                  "name": "ConfigurationMemberFunctionalTest"
                }
              },
              {
                "__typename": "DesignItem",
                "id": "urn:adsk.wipprod:dm.lineage:7EDGkj_6RkKDz8ZgwHz-5w",
                "name": "Box",
                "rootComponent": {
                  "id": "Y29tcH5jby5uckdoR0ZIb1FXU3NQdFlhU0V2YThnfnhHTFhxNkZIMlk2dDVOdDJPYkxaOVdfYWdh",
                  "name": "Box"
                },
                "tipRootComponentVersion": {
                  "id": "Y29tcH5jby5uckdoR0ZIb1FXU3NQdFlhU0V2YThnfnhHTFhxNkZIMlk2dDVOdDJPYkxaOVdfYWdhfkUzSVZDNVJJclRIOTVQZzVCVnRzQjg",
                  "name": "Box"
                }
              },
              {
                "__typename": "DrawingItem",
                "id": "urn:adsk.wipprod:dm.lineage:yZzkl_veQx2CCliBLwguCQ",
                "name": "ME Data Test Drawing"
              }
             ]
            }
           }
          }
      
      Show More

    Step 2 - Retrieve Items within a Folder

    The following steps demonstrate how you can run the itemsByFolder query to retrieve all the Items within a folder.

    1. Enter the following query in the Query Pane of the Manufacturing Data Model Explorer.

      Query

      query GetFolderItemsByFolder($hubId: ID!, $folderId: ID!) {
            itemsByFolder(hubId: $hubId, folderId: $folderId) {
                results {
                  __typename
                  id
                  name
                  ... on DesignItem {
                    id
                    name
                    rootComponent {
                      id
                      name
                    }
                    tipRootComponentVersion {
                      id
                      name
                    }
                  }
                }
              }
            }
      
      Show More
    2. In the Query Variables Pane, enter the value of the hubId and folderId. To know how to obtain the hubId, refer to Retrieve Hubs.

      Query Variables

      {
        "hubId":    "urn:adsk.ace:prod.scope:42db5214-7dfe-431a-8275-2ea47d5686d5",
        "folderId": "urn:adsk.wipprod:fs.folder:co.neOeWDZ2THyEog4s2vqFQg"
      }
      
    3. Click Play. A list of Items within a folder is displayed in the response.

      Response

      {
        "data": {
          "itemsByFolder": {
            "results": [
              {
                "__typename": "ConfiguredDesignItem",
                "id": "urn:adsk.wipprod:dm.lineage:3nKEsAAJRg2KuNLCl-UH5w",
                "name": "ConfigTest"
              },
              {
                "__typename": "DesignItem",
                "id": "urn:adsk.wipprod:dm.lineage:AmkSu2iNRLiiELZQxAWhgQ",
                "name": "Normal-Design-New",
                "rootComponent": {
                  "id": "Y29tcH5jby5uckdoR0ZIb1FXU3NQdFlhU0V2YThnflRaTUxQclZ0Q1hqNmJvQXdsOWppc3FfYWdh",
                  "name": "Normal-Design-New"
                },
                "tipRootComponentVersion": {
                  "id": "Y29tcH5jby5uckdoR0ZIb1FXU3NQdFlhU0V2YThnflRaTUxQclZ0Q1hqNmJvQXdsOWppc3FfYWdhflRITEs5MzdJR3V5VXNUQkhuUVliTXA",
                  "name": "Normal-Design-New"
                }
              },
              {
                "__typename": "ConfiguredDesignItem",
                "id": "urn:adsk.wipprod:dm.lineage:B_mqmfHXQ8-luAzgisFI3w",
                "name": "design-for-model-occurence"
              },
              {
                "__typename": "DesignItem",
                "id": "urn:adsk.wipprod:dm.lineage:FgnbBe-JSm6g5jzE6xo1UA",
                "name": "Normal-design-supergraph-test",
                "rootComponent": {
                  "id": "Y29tcH5jby5uckdoR0ZIb1FXU3NQdFlhU0V2YThnfmRBNHdycUk4ellBUGhRMWN3UDFmczNfYWdh",
                  "name": "Normal-design-supergraph-test"
                },
                "tipRootComponentVersion": {
                  "id": "Y29tcH5jby5uckdoR0ZIb1FXU3NQdFlhU0V2YThnfmRBNHdycUk4ellBUGhRMWN3UDFmczNfYWdhfjVIRXcxRzRyRWJIR0FlZENrVzN5bDY",
                  "name": "Normal-design-supergraph-test"
                }
              },
              {
                "__typename": "ConfiguredDesignItem",
                "id": "urn:adsk.wipprod:dm.lineage:SCdayUdRQZW7pkbfy9RpBQ",
                "name": "Configured-Design"
              },
              {
                "__typename": "DesignItem",
                "id": "urn:adsk.wipprod:dm.lineage:Xbm07TlnTquPKdFrF756bg",
                "name": "Normal-Design",
                "rootComponent": {
                  "id": "Y29tcH5jby5uckdoR0ZIb1FXU3NQdFlhU0V2YThnfkhxOThQSlYwMVVIVWZPUjdXaTA1elVfYWdh",
                  "name": "Normal-Design"
                },
                "tipRootComponentVersion": {
                  "id": "Y29tcH5jby5uckdoR0ZIb1FXU3NQdFlhU0V2YThnfkhxOThQSlYwMVVIVWZPUjdXaTA1elVfYWdhflNZRHYyMUhPWmpzNmhZbWk1M0xQQlY",
                  "name": "Normal-Design"
                }
              },
              {
                "__typename": "DesignItem",
                "id": "urn:adsk.wipprod:dm.lineage:_K20F311R-K-LaJ4VxPCtQ",
                "name": "normalTEst",
                "rootComponent": {
                  "id": "Y29tcH5jby5uckdoR0ZIb1FXU3NQdFlhU0V2YThnfnljVjJEcGtQMVdKM1d3UnVRTmhCM3VfYWdh",
                  "name": "normalTEst"
                },
                "tipRootComponentVersion": {
                  "id": "Y29tcH5jby5uckdoR0ZIb1FXU3NQdFlhU0V2YThnfnljVjJEcGtQMVdKM1d3UnVRTmhCM3VfYWdhfmZQQW54MWtzT3BSMWVDTXhRc3k2NE0",
                  "name": "normalTEst"
                }
              },
              {
                "__typename": "DesignItem",
                "id": "urn:adsk.wipprod:dm.lineage:q_eTO0skS4yvFEJA6qSxpw",
                "name": "main-design-for-model-occurence",
                "rootComponent": {
                  "id": "Y29tcH5jby5uckdoR0ZIb1FXU3NQdFlhU0V2YThnfko1RlJVYjBYbU1ieHdXVFBneG9PdXhfYWdh",
                  "name": "main-design-for-model-occurence"
                },
                "tipRootComponentVersion": {
                  "id": "Y29tcH5jby5uckdoR0ZIb1FXU3NQdFlhU0V2YThnfko1RlJVYjBYbU1ieHdXVFBneG9PdXhfYWdhfndHdVVqdzNVbks2SGNXR2dTbWZKVjQ",
                  "name": "main-design-for-model-occurence"
                }
              },
              {
                "__typename": "ConfiguredDesignItem",
                "id": "urn:adsk.wipprod:dm.lineage:rjwmFUfBTmGzq12GgYO4ig",
                "name": "Configured-Design-New"
              }
             ]
            }
           }
          }
      
      Show More