Request

Response

    Retrieve a Cost Container ID

    This tutorial demonstrates how to retrieve a BIM 360 cost management container ID for a BIM 360 project. Each BIM 360 project is assigned with a cost container that stores all the cost data for the project. The cost container ID is used to call the BIM 360 cost endpoints. To retrieve the ID, you need to call several Data Management endpoints.

    Before You Begin

    Step 1: Find the Hub ID

    You must first call GET hubs to find the account ID for your BIM 360 account.

    Note that the BIM 360 account ID corresponds to a Data Management hub ID. To convert an account ID into a hub ID you need to add a “b.” prefix. For example, an account ID of c8b0c73d-3ae9 translates to a hub ID of b.c8b0c73d-3ae9.

    In this example, assume that the project for which you want the container is part of the “John’s Account” hub.

    Request

    curl -X GET -H "Authorization: Bearer nFRJxzCD8OOUr7hzBwbr06D76zAT" "https://developer.api.autodesk.com/project/v1/hubs"
    

    Response

    {
      "jsonapi": {
        "version": "1.0"
      },
      "links": {
        "self": {
          "href": "https://developer.api.autodesk.com/project/v1/hubs"
        }
      },
      "data": [
        {
          "type": "hubs",
          "id": "b.cGVyc29uYWw6cGUyOWNjZjMy",
          "attributes": {
            "name": "John's Account",
            "extension": {
              "type": "hubs:autodesk.bim360:Account",
              "version": "1.0",
              "schema": {
                "href": "https://developer.api.autodesk.com/schema/v1/versions/hubs:autodesk.bim360:Account-1.0"
              },
              "data": {}
            }
          }
        }
      ]
    }
    
    Show More

    Step 2: Find the Container ID for the Project

    Use the BIM 360 hub ID that you retrieved in the previous step (b.cGVyc29uYWw6cGUyOWNjZjMy) to call GET hubs/:hub_id/projects, and retrieve a list of all the projects in the hub to which the user has access. In this example, we have added a filter to return only details of a specific project “Demo Project.”

    Request

    curl -X GET -H "Authorization: Bearer nFRJxzCD8OOUr7hzBwbr06D76zAT" "https://developer.api.autodesk.com/project/v1/hubs/b.cGVyc29uYWw6cGUyOWNjZjMy/projects?filter%5Battributes.name%5D=Demo%20Project"
    

    Response

    {
      "jsonapi": {
        "version": "1.0"
      },
      "links": {
        "self": {
          "href": "https://developer.api.autodesk.com/project/v1/hubs/b.cGVyc29uYWw6cGUyOWNjZjMy/projects"
        }
      },
      "data": [
        {
          "type": "projects",
          "id": "b.cGVyc29uYWw6cGUyOWNjZjMyI0QyMDE2MDUyNDEyOTI5NzY",
          "attributes": {
            "name": "Demo Project",
            "extension": {
              "type": "projects:autodesk.bim360:Project",
              "version": "1.0",
              "schema": {
                "href": "https://developer.api.autodesk.com/schema/v1/versions/projects%3Aautodesk.bim360%3AProject-1.0"
              },
              "data": {}
            }
          },
          "links": {
            "self": {
              "href": "https://developer.api.autodesk.com/project/v1/hubs/b.cGVyc29uYWw6cGUyOWNjZjMy/projects/b.57be304852e74856a61bf25acebc200f"
            }
          },
          "relationships": {
            "hub": {
              "data": {
                "type": "hubs",
                "id": "b.cGVyc29uYWw6cGUyOWNjZjMy"
              },
              "links": {
                "related": {
                  "href": "https://developer.api.autodesk.com/project/v1/hubs/b.cGVyc29uYWw6cGUyOWNjZjMy"
                }
              }
            },
            "rootFolder": {
              "data": {
                "type": "folders",
                "id": "urn:adsk.wipprod:fs.folder:co.uvDiLQ5DRYidDQ_EFW1OOg"
              },
              "meta": {
                "link": {
                  "href": "https://developer.api.autodesk.com/data/v1/projects/b.57be304852e74856a61bf25acebc200f/folders/urn%3Aadsk.wipprod%3Afs.folder%3Aco.uvDiLQ5DRYidDQ_EFW1OOg"
                }
              }
            },
            "topFolders": {
                "links": {
                    "related": {
                        "href": "https://developer.api.autodesk.com/project/v1/hubs/b.cGVyc29uYWw6cGUyOWNjZjMy/projects/b.57be304852e74856a61bf25acebc200f/topFolders"
                    }
                }
            },
            "cost": {
                "data": {
                    "type": "costContainerId",
                    "id": "18ece8b1-204d-11e8-ad71-d73b169f902a"
                }
            }
          }
        }
      ]
    }
    
    Show More

    The response payload includes the container ID (data.relationships.cost.data.id). You’ll use this ID in Cost API calls for this project.