1

I am trying to receive data via Autodesk Data Management API. So far I've created an Forge-App and connected it with a BIM360 Integration. Then I wanted to get a list of all hubs, but when I do so, I receive an JSON-Object which contains a warning:

warnings: [{
     "AboutLink":null,
     "Detail":""You don't have permission to access this API",
     "ErrorCode": "BIM360DM_ERROR",
     "HttpStatusCode": "403",
     ...
}]

I called the webservice via AJAX which looks like that:

this.getToken(function(token) {
        $.ajax({
            url: "https://developer.api.autodesk.com/project/v1/hubs",
            beforeSend: function(xhr) {
                xhr.setRequestHeader("Authorization", "Bearer "+token);
            }
        }).done(...);

The token is a 3-legged one. I am not sure which API I do not have permission for because I am pretty sure, that I have permission for BIM360.(I created the Integration as an administrator).

Jason Aller
  • 3,541
  • 28
  • 38
  • 38
Andreas
  • 309
  • 1
  • 8

2 Answers2

1

Does everything else work fine? For example, can you get all the hubs successfully? I just verified on my side, and I can see the response including the same warning as you mentioned, but the hubs are listed correctly, and you can get the projects/items/versions without problem. I pasted my postman response as follow.enter image description here

If you check the blog https://forge.autodesk.com/blog/tutorial-using-curl-3-legged-authentication-bim-360-docs-upload, it also has the same warning, but seems no impact to the following operation. I am not exactly sure what the warning means, l will check and update the details, but so far, it seems you can ignore it for now.

Zhong Wu
  • 1,721
  • 1
  • 8
  • 9
  • The data array is empty. Maybe I do not have any hubs? In fact I am not sure what a hub is, in the context of bim360. I have an Project an in this projects i can have folders and documents. But what is a hub? – Andreas Jul 06 '17 at 07:24
  • You are using 3 legged access token, so when the user provide the permission to his account, make sure the user has access to either BIM 360 Team, Fusion Team, A360 Personal or BIM 360 Docs. For details about hub, please check the doc at https://developer.autodesk.com/en/docs/data/v2/overview/basics/ – Zhong Wu Jul 06 '17 at 07:41
  • Ok thanks. I've checked that. I am sure that my user has access to BIM 360 docs. I can see my projects under [docs.b360.autodesk.com](http://docs.b360.autodesk.com). – Andreas Jul 06 '17 at 07:49
  • Nevermind. A colleague of mine tested it and he gets a result. So it seems that I am missing some permissions – Andreas Jul 06 '17 at 08:19
  • Ok i've checked all settings and I do not see it. I can view my Projects @ [docs.b360.autodesk.com](http://docs.b360.autodesk.com). Does this mean, that I have access to BIM 360 Docs? And if I have projects, doesn't that mean I must have a hub? – Andreas Jul 06 '17 at 09:13
1

In addition to was ZHong mentioned, I would suggest you try this sample. It will ask you to provision your Forge Client ID under your BIM 360 settings, just follow the steps that the app will present.

On both 2- or 3-legged, the app accessing the data (Forge Client ID) needs authorization from the account admin. Without that, the Hubs endpoint will not return your BIM 360 hub, and inside that, the sample applies for Projects endpoint.

Augusto Goncalves
  • 8,493
  • 2
  • 17
  • 44