Verify the Project Type
This tutorial demonstrates how to use the Data Management API to verify whether a project in a BIM 360 account or an Autodesk Construction Cloud (ACC) account is from the BIM 360 platform or from the Autodesk Construction Cloud platform (ACC). This can be helpful, for example, if you have an app that is using both BIM 360 and ACC projects, and you want to manage users’ folder permissions - BIM 360 folders and ACC folders have slightly different sets of permissions.
The unified Autodesk Construction Cloud platform (ACC) is Autodesk’s new construction management software. For more information about ACC, see the Autodesk Construction Cloud website.
Before You Begin
- Register an app, and select the Data Management and BIM 360 APIs.
- Acquire a 2-legged or 3-legged OAuth token with the
data:read
scope. - Verify that you have access to the relevant BIM 360 account.
Step 1: Find the Hub ID for the BIM 360 Account
Find the hub ID for the BIM 360 account you are interested in, by calling GET hubs.
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 d952a4eb-ad57-4d64-b9ab-d540b3b4522e translates to a hub ID of b.d952a4eb-ad57-4d64-b9ab-d540b3b4522e.
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.d6cf8c84-c25e-4534-ae5c-62e08480e751",
"attributes": {
"name": "My First 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": {}
}
}
}
]
}
In this example, assume that the account you are interested in is in a hub called My First Account
.
Find the hub (data.name
), and note the hub ID - b.d6cf8c84-c25e-4534-ae5c-62e08480e751
.
Step 2: Find the Project Type
To get a list of all the BIM 360 and ACC projects in the hub (account), use the hub ID (b.d6cf8c84-c25e-4534-ae5c-62e08480e751
) to call GET hubs/:hub_id/projects.
Note that the project ID in BIM 360 corresponds to the project ID in the Data Management API. To convert a project ID in BIM 360 to a project ID in the Data Management API, you need to add a “b." prefix. For example, a project ID of a4be0c34a-4ab7 translates to a project ID of b.a4be0c34a-4ab7.
Request
curl -X GET -H "Authorization: Bearer nFRJxzCD8OOUr7hzBwbr06D76zAT" "https://developer.api.autodesk.com/project/v1/hubs/b.d6cf8c84-c25e-4534-ae5c-62e08480e751/projects"
Response
{
"jsonapi": {
"version": "1.0"
},
"links": {
"self": {
"href": "https://developer.api.autodesk.com/project/v1/hubs/b.d6cf8c84-c25e-4534-ae5c-62e08480e751/projects"
}
},
"data": [
{
"type": "projects",
"id": "f6a1e3b5-abaa-4b01-b33a-5d55f36ba047",
"attributes": {
"name": "My First Project",
"extension": {
"type": "projects:autodesk.core:Project",
"version": "1.0",
"data": {
"projectType": "ACC"
}
}
}
}
]
}
In this example, assume that My First Project
is the project you are interested in.
Find the project (data.attributes.name
) and note whether the project type (data.attributes.extension.data.projectType
) is ACC
or BIM360
.