Task 1 – Get Hubs
This task instructs how you can send a request to the AEC Data Model server and receive a response in a few steps.
By the end of this task, you will be able to:
- Send a query using AEC Data Model Explorer.
- Understand the fields in the hubs query, Hubs object, and Hub objects.
You will use the following queries in this task:
Type | Operation | Description |
---|---|---|
Query | hubs | Retrieves all hubs accessible to you. |
Step 1: Request a list of Hubs
The hubs query returns a Hubs object. The Hubs object contains an array of Hub objects. While the Hub object has many fields, for this exercise, we will be requesting the id
and the name
fields only.
- In AEC Data Model Explorer, the query is populated by default in the Query Pane. You can also edit or update the query as per your requirement and run it.
Query
query GetHubs { hubs { pagination { cursor } results { name id } } }
Show More- Click Play. A list of hubs that you have access to is displayed in the response section. It should be similar to the following code-block:
Response
{ "data": { "hubs": { "pagination": { "cursor": null }, "results": [ { "name": "AEC DM Developer Advocacy Support", "id": "urn:adsk.ace:prod.scope:dccde3e3-c20c-40d3-a27c-7ac53b051b6e" }, { "name": "Developer Advocacy Support", "id": "urn:adsk.ace:prod.scope:c0c44a35-fc67-4a8d-8967-f2d975bc03ec" } ] } } }
Show MoreNote down the ID of the hubs that you wish to use. You will need this ID for the remaining tasks. For illustration, in this tutorial we have used the ID of the hub named
AEC Data Model Account
.After working through the steps mentioned above, you should see a screen similar to the following image:
![]()