We are using BIM360 docs and we have defined several custom attributes to tag those files uploaded into the docs folder. Now we are having trouble to get those custom attribute using forge API, projects/:project_id/items/:item_id endpoint only returns those default attribute like file name/description but for custom attributes it's not included in the response, neither can i update those custom attributes use PATCH to update those custom attributes.
Does Autodesk Forge API support getting/updating custom attributes?
The attribute node I got from the item API looks like this:
"attributes": {
"name": "somefile.rvt",
"displayName": "somefile.rvt",
"createTime": "2018-08-02T18:16:59.0000000Z",
"createUserId": "creatorID",
"createUserName": "usercreate",
"lastModifiedTime": "2018-11-01T10:46:20.0000000Z",
"lastModifiedUserId": "userid",
"lastModifiedUserName": "username",
"versionNumber": 1,
"extension": {
"type": "versions:autodesk.bim360:Document",
"version": "1.0",
"schema": {
"href": "https://developer.api.autodesk.com/schema/v1/versions/versions:autodesk.bim360:Document-1.0"
},
"data": {
"processState": "PROCESSING_COMPLETE",
"viewableId": "id",
"viewableGuid": "id",
"viewableName": "Existing",
"sourceFileName": "somefile.rvt"
}
}
}
Thanks.
AFAIK, the information of folder/file is provided by Forge Data Management API, this API is used as a common access to many different Autodesk SAAS app like A360 Personal, BIM 360 Team, Fusion Team (formerly known as A360 Team), BIM 360 Docs.
Unfortunately, since the custom attributes are specified only for BIM360 Docs(correct me if I am wrong), so the Folder/Item API of Forge Date Management does not provide that information yet. I am also checking with our engineering team to see if any other information, or this could be a good API request, will update this if I got more information.
Related
I have my own Forge APP now, but after I upload those rvt files I hope to get all of the URLs of those files. Can it be possible?Hope to get Url data automatically. Appreciate for all comments. enter image description here
What kind of URL link do you want? The UI in your snapshot looks like the Fusion Team/BIM360 Team. So, I supposed that you want to view the model with Forge Viewer or download the Revit source file.
To access data of the Fusion Team/BIM360 Team, you can refer to View Hub Model tutorial.
To get data of your Revit files uploaded to the Fusion team, you will need to use those endpoints of Forge Data Management API
GET hubs -> HubsApi#GetHubs
GET projects -> ProjectsApi#GetHubProjects
GET topFolders -> ProjectsApi#GetProjectTopFolders
GET folder contents -> FoldersApi#GetFolderContents
Afterward,
To view the Revit model with Forge View, you need to find the derivative urn under either version tip of the file by this path relationships.derivatives.data.id. e.g.
"derivatives": {
"data": {
"type": "derivatives",
"id": "dXJuOmFkc2sud2lwcHJvZDpmcy5maWxlOnZmLnlDV0dSdUhnUW5PeENIdk1oalQxZEE_dmVyc2lvbj0x"
},
"meta": {
"link": {
"href": "https://developer.api.autodesk.com/modelderivative/v2/designdata/dXJuOmFkc2sud2lwcHJvZDpmcy5maWxlOnZmLnlDV0dSdUhnUW5PeENIdk1oalQxZEE_dmVyc2lvbj0x/manifest?scopes=global"
}
}
},
To download the Revit source file, you need to find the storage id under either version tip of the file by this path relationships.storage.data.id. e.g.
"storage": {
"data": {
"type": "objects",
"id": "urn:adsk.objects:os.object:wip.dm.prod/0213357d-03b1-4ab1-95f6-bff154b775ae.ifc"
},
"meta": {
"link": {
"href": "https://developer.api.autodesk.com/oss/v2/buckets/wip.dm.prod/objects/0213357d-03b1-4ab1-95f6-bff154b775ae.ifc?scopes=global"
}
}
}
Lastly, please be noted models stored on the Fusion Team/BIM360 Team is on demand translation. Before viewing the model with Forge Viewer, you must open the overview page of the model on your Fusion Team/BIM360 Team project's Web UI like the below, and ensure that here no veiw is loading, then you’re fine to open the model with Forge Viewer, Otherwise, it means your model translation job is still processing.
Via the BIM360 API, I am able to create Quality Issues and upload files (to be used as attachments). However, even though I am calling Post Attachments (https://forge.autodesk.com/en/docs/bim360/v1/reference/http/field-issues-attachments-POST/) (and all responses are good), nothing appears on the Issue screen.
Issue screen with manually added file. How can I make my attached file appear under the References->Files section?
(Note, I saw a mention elsewhere of the relationships API, but I get a random error just calling the first "asset" API [{"title":"Forbidden","detail":"Forbidden","errorCode":"GENERAL_ERROR","type":"https://developer.api.autodesk.com/bim360/assets/v1/error-codes/GENERAL_ERROR"}])
firstly, the screenshot shows you are working with Issues in Autodesk Construction Cloud (ACC), while the API you are using is for BIM360 Issue. This API is NOT compatible with ACC.
To work with ACC Issue, the API is available at the category of ACC:
https://forge.autodesk.com/en/docs/acc/v1/reference/http/issues-issues-GET/
this blog tells more.
https://forge.autodesk.com/blog/acc-issues-api-available-preview
In the context of ACC, the attachment(references) is managed by the general API (Relationship API). In Additional Tests of Postman collection of ACC Issue API, I demoed how to add Photo with the Issue. The logic is similar.
https://github.com/Autodesk-Forge/forge-acc.issues.api-postman.collection
Firstly, use Data Management API to get the document urn. Then, use ACC Issue API to get id of one issue. finally, use Relationship API to bind them.
PUT https://developer.api.autodesk.com/bim360/relationship/v2/containers/{{project_id_without_b}}/relationships
P.s. -bim360- in the domains is just because of legacy design of the terminologies. It can work for the contexts of both BIM360 and ACC (note it is Relationship API can work within both of the contexts)
Payload:
[
{
"entities": [
{
"domain": "autodesk-bim360-issue",
"type": "issue",
"id": "{{one_issue_id}}"
},
{
"domain": "autodesk-bim360-documentmanagement",
"type": "documentlineage",
"id": "{{one_document_urn}}"
}
]
}
]
We are working on providing access to BIM 360 projects programmatically. We allow project admin to select user and role combination to provide access to BIM 360 project.
Once user and role combinations are added, we call import users BIM 360 API and pass the required JSON body. API Reference: https://forge.autodesk.com/en/docs/bim360/v1/reference/http/projects-project_id-users-import-POST/
There is service access associated with each role. So we are passing the service access information accordingly.
We are able to give access to document_management and project_administration service objects.
But we need to also give access to Project Management, Insight and other available services. If we pass insight or project_management service name we get error as
Invalid services ["project_management"]
and similar error for insight service.
We are passing below sample JSON body:
[
{
"email": "userEmail",
"services": {
"document_management": {
"access_level": "admin"
},
"project_administration": {
"access_level": "admin"
},
"project_management": {
"access_level": "admin"
}
},
"company_id": "companyId",
"industry_roles": [
"roleid1",
"roleid2"
]
}
]
If we remove project_management object from above JSON, the access works fine.
How can we provide access to these and other available services? or are we missing something?
Thank you!
Unfortunately, it's a known limitation of Admin API :-( although it is a high demanded feature.
We have a wish logged against it:
ACSADMIN-530 (was HQ-3034): “API wish: adding users beyond Docs”
Sorry for the bad news.
We have a Revit model where we have configured a single 3D View in Publish Settings. We published that model to BIM 360 and are using Forge to extract the list of 3D Views.
We notice that after the model is translated, the only views available in BIM360 are the views included as set in the Publish Settings in Revit, irregardless of phase, but are under the Phases icon, when we extract the Views from the manifest we also get additional views that were created because some objects belong to different Phases. We don’t seem to be able to distinguish between the different views or see a relationship between different phases of the same view.
Is there a way to do that? or not to translate the additional phase views at all?
The extract below shows us the {3D} view and the Phase Views created “Existing” and “New Construction” using GET
https://developer.api.autodesk.com/modelderivative/v2/designdata/:urn/manifest
Manifest:
Those phased 3D views are from the mater view for each phase, you can suppress them by submitting translation jobs like below:
// POST https://developer.api.autodesk.com/modelderivative/v2/designdata/job
// with `x-ads-force: true` Reuest header
{
"input": {
"urn": "dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6YWRuZGVtby9ob3VzZS5ydnQ"
},
"output": {
"formats": [
{
"type": "svf",
"views": [
"2d",
"3d"
],
"advanced": {
"generateMasterViews": false
}
}
]
}
}
Note. The generateMasterViews option in BIM360 Docs is turned on by default and the translation job will be submitted automatically while the model was uploaded to Docs managed bucket successfully, currently.
Note 2. Triggering any translation jobs yourself on the models of the BIM360 Docs will consume extra Forge Cloud Credits. So, you have to use it carefully at your own risk.
Ref: https://forge.autodesk.com/en/docs/model-derivative/v2/reference/http/job-POST/#body-structure
I've extracted the the folder content from bim 360:
Result
{
"type": "items",
"id": "urn:adsk.wipprod:dm.lineage:huksL2JVQ2Gy4n4EEOY9Mg",
"attributes": {
"displayName": "4storeyy.ifc",
...
"data": {
"sourceFileName": "4storeyy.ifc"
}
}
},
}
The id (URN) is the same as the one in the URL when I view it in BIM 360.
If I use the URN in my custom viewer, it does not work.
https://developer.api.autodesk.com/modelderivative/v2/designdata/dXJuOmFkc2sud2lwcHJvZDpkbS5saW5lYWdlOlgyOU1ydUhZUWJXV21feE1MNndLZmc=/manifest gives not found
Is this how you should do it if you want to read the model from BIM 360? If so, what can am I doing wrong?
Or do I need to run download it, translate it before reading it?
Yes you will need to translate the model before being able to load it on Viewer.
Simply follow the usual steps here except that you shouldn't need to download and upload the model again and can use the ID on wipprod for translation straight away.