shaneshaneshane
shaneshaneshane

Reputation: 59

Autodesk Forge GET hubs returns hubs I don't have / currently use

I’m reading through the tutorial (https://forge.autodesk.com/en/docs/data/v2/tutorials/publish-model/) to automatically publish projects, and having troubles when using GET hubs – I’m currently using postman, and set up a 3 legged auth token with data:read, data:write, and data:create using the example here - https://forge.autodesk.com/blog/3-legged-authentication-postman

I get the correct response back using GET users/@me (see below). So I think that the authentication is working properly.

    "userId": "**OBSCURED**",
    "userName": "shane@**OBSCURED**",
    "emailId": "shane@**OBSCURED**",
    "firstName": "Shane",
    "lastName": "**OBSCURED**",
    "emailVerified": true,
    "2FaEnabled": false,
    "countryCode": "US",
    "language": "en",
    "optin": false,
    "lastModified": "2020-09-08T19:31:48.802",
    "profileImages": {
        "sizeX20": "https://s3.amazonaws.com:443/com.autodesk.storage.public.production/oxygen/**OBSCURED**/profilepictures/x20.jpg?r=**OBSCURED**",
        "sizeX40": "https://s3.amazonaws.com:443/com.autodesk.storage.public.production/oxygen/**OBSCURED**/profilepictures/x40.jpg?r=**OBSCURED**",
        "sizeX50": "https://s3.amazonaws.com:443/com.autodesk.storage.public.production/oxygen/**OBSCURED**/profilepictures/x50.jpg?r=**OBSCURED**",
        "sizeX58": "https://s3.amazonaws.com:443/com.autodesk.storage.public.production/oxygen/**OBSCURED**/profilepictures/x58.jpg?r=**OBSCURED**",
        "sizeX80": "https://s3.amazonaws.com:443/com.autodesk.storage.public.production/oxygen/**OBSCURED**/profilepictures/x80.jpg?r=**OBSCURED**",
        "sizeX120": "https://s3.amazonaws.com:443/com.autodesk.storage.public.production/oxygen/**OBSCURED**/profilepictures/x120.jpg?r=**OBSCURED**",
        "sizeX160": "https://s3.amazonaws.com:443/com.autodesk.storage.public.production/oxygen/**OBSCURED**/profilepictures/x160.jpg?r=**OBSCURED**",
        "sizeX176": "https://s3.amazonaws.com:443/com.autodesk.storage.public.production/oxygen/**OBSCURED**/profilepictures/x176.jpg?r=**OBSCURED**",
        "sizeX240": "https://s3.amazonaws.com:443/com.autodesk.storage.public.production/oxygen/**OBSCURED**/profilepictures/x240.jpg?r=**OBSCURED**",
        "sizeX360": "https://s3.amazonaws.com:443/com.autodesk.storage.public.production/oxygen/**OBSCURED**/profilepictures/x360.jpg?r=**OBSCURED**"
    },
    "ldapInfo": {
        "ldapEnabled": false
    },
    "socialUserInfoList": []
}

When I try with the same token to get hubs (using the developer docs here https://forge.autodesk.com/en/docs/data/v2/reference/http/hubs-GET/) I get the response shown below. I expect to see the accounts listed in my docs.bim360.autodesk.com projects as shown in the screenshot below. I read online that sometimes provisioning needs to be done by Autodesk to get the right stuff to show up – it seems these are hubs that I’m no longer using and set up in the early days of our bim360 account (I believe these hubs are reflective of our very first b360 project, and a test project I set up).

I’ve also tried to get projects with the hub id’s listed below, but get 404 errors saying that they do not exist.

I am also not sure if the warnings at the end of the response are the two hubs I’m looking for, because I’m writing my request wrong, or something else. I get a 200 OK back, but it seems like what I’m looking for is missing.

{
    "jsonapi": {
        "version": "1.0"
    },
    "links": {
        "self": {
            "href": "https://developer.api.autodesk.com/project/v1/hubs"
        }
    },
    "data": [
        {
            "type": "hubs",
            "id": "a.YnV**OBSCURED**NjU",
            "attributes": {
                "name": "**OBSCURED**",
                "extension": {
                    "type": "hubs:autodesk.core:Hub",
                    "version": "1.0",
                    "schema": {
                        "href": "https://developer.api.autodesk.com/schema/v1/versions/hubs:autodesk.core:Hub-1.0"
                    },
                    "data": {}
                },
                "region": "US"
            },
            "links": {
                "self": {
                    "href": "https://developer.api.autodesk.com/project/v1/hubs/a.YnVz**OBSCURED**uNjU"
                }
            },
            "relationships": {
                "projects": {
                    "links": {
                        "related": {
                            "href": "https://developer.api.autodesk.com/project/v1/hubs/a.YnVza**OBSCURED**uNjU/projects"
                        }
                    }
                }
            }
        },
        {
            "type": "hubs",
            "id": "a.YnVz**OBSCURED**ltNQ",
            "attributes": {
                "name": "shane",
                "extension": {
                    "type": "hubs:autodesk.core:Hub",
                    "version": "1.0",
                    "schema": {
                        "href": "https://developer.api.autodesk.com/schema/v1/versions/hubs:autodesk.core:Hub-1.0"
                    },
                    "data": {}
                },
                "region": "US"
            },
            "links": {
                "self": {
                    "href": "https://developer.api.autodesk.com/project/v1/hubs/a.YnVz**OBSCURED**tNQ"
                }
            },
            "relationships": {
                "projects": {
                    "links": {
                        "related": {
                            "href": "https://developer.api.autodesk.com/project/v1/hubs/a.YnVz**OBSCURED**ltNQ/projects"
                        }
                   }
                }
            }
        }
    ],
    "meta": {
        "warnings": [
            {
                "Id": null,
                "HttpStatusCode": "403",
                "ErrorCode": "BIM360DM_ERROR",
                "Title": "Unable to get hubs from BIM360DM US.",
                "Detail": "You don't have permission to access this API",
                "AboutLink": null,
                "Source": [],
                "meta": []
            },
            {
                "Id": null,
                "HttpStatusCode": "403",
                "ErrorCode": "BIM360DM_ERROR",
                "Title": "Unable to get hubs from BIM360DM EMEA.",
                "Detail": "You don't have permission to access this API",
                "AboutLink": null,
                "Source": [],
                "meta": []
            }
        ]
    }
}

Here's what I see in my docs.b360.autodesk.com portal

enter image description here

Am I understanding this right, that hubs are “accounts” in the above screenshot? And projects would be projects listed in those accounts/hubs?

Upvotes: 0

Views: 668

Answers (1)

Petr Broz
Petr Broz

Reputation: 9942

In order to see your BIM360 accounts listed among the hubs, you do have to provision the access for every single Forge app.

And yes, the BIM360 "accounts" would show up as individual "hubs" (starting with b.) in the response of the GET hubs call.

Upvotes: 1

Related Questions