6 Jul 2020
Errors when retrieving hubs
When using the GET hubs endpoint you may get a list of errors in the meta section of the reply, even though the request itself succeeded, statusCode = 200 (see picture on top)
It does not necessarily mean there is anything wrong with your Forge app or the user's access to their BIM 360 account. The fact that the status code of the request is 200 (i.e. OK) is good news.
When you call this endpoint it will also try to retrieve hubs from each supported BIM 360 region (currently US and EMEA). If the user has access to an EMEA based account and the Forge app has only been enabled for that, then you would still get an error for the US region, but you don't have to worry about that.
Note: you can enable a Forge app for a specific BIM 360 account by adding it under "Settings" >> "Custom Integrations":
More info about it here: https://forge.autodesk.com/blog/bim-360-docs-provisioning-forge-apps
The documentation of the GET hubs endpoint lists these error codes:
200
OK |
Successful retrieval of the hubs collection. |
401
Unauthorized |
The supplied Authorization header was not valid or the supplied token scope was not acceptable. Verify Authentication and try again. |
403
Forbidden |
The request was successfully validated but permission is not granted or the application has not been white-listed. Do not try again unless you solve permissions first. |
This is how I would translate their meaning when they show up in the meta section of the response:
1) "401"
"BIM360DM_ERROR"
"You do not have permission to access this project. Please contact your project administrator if you believe you have received this message in error."
"Unable to get hubs from BIM360DM EMEA." OR "Unable to get hubs from BIM360DM US."
Meaning: you get this error if the Forge App has been added under "Settings" >> "Custom Integrations" to at least one BIM 360 account in the specific region (US or EMEA), but the user logged in is not part of a BIM 360 account in that region.
2) "403"
"BIM360DM_ERROR"
"You don't have permission to access this API"
"Unable to get hubs from BIM360DM EMEA." OR "Unable to get hubs from BIM360DM US."
Meaning: you get this error if the Forge App has not been added under "Settings" >> "Custom Integrations" to any BIM 360 account in the specific region (US or EMEA). It does not indicate whether the user logged in is part of a BIM 360 account in that region or not.