Autodesk Forge BIM 360 API - Activating Service Types - autodesk-forge

We have been using the Forge API to automatically set up projects in BIM 360, but seem unable to find a way to automatically activate a Service (Field, Glue, etc.).
Intuitively, I would have thought that the "service_types" attribute would be the way to do this, but the services are not activating.
1) What does the "service_types" attribute actually do?
2) If possible, how do we activate a project Service using the Forge API (Most specifically Field)?
Thank you kindly,

Re. #1
Your understanding of service_type is correct.
Re. #2
Could you try below after you create a project?
https://developer.autodesk.com/en/docs/bim360/v1/reference/http/projects-project_id-users-POST/
e.g., with the body like this:
{
"role": "project_admin",
"service_type": "field",
"company_id": "77e4444e-5dad-46a2-ad29-555cc00452a0",
"email": "my.name#autodesk.com"
}
I verified that having service_type in project creation itself does not have effect. And the documentation is a little confusing. But if you use the above method, it works. Note that you need to have Field license with you account.
There is also a tutorial page:
https://developer.autodesk.com/en/docs/bim360/v1/tutorials/activate-service/

Related

update bim360 Revit cloud model using design automation

I tried to modify properties of bim360 Revit cloud model using design automation (versionType: 'versions:autodesk.bim360:C4RModel'), got below error:
{id: 'ce58ade7-b556-4817-9ea9-f2180346ddac', status: '400', code: 'BAD_INPUT', title: 'Object violates schema "versions:autodesk.bim360:C4RModel-1.0".', detail: 'See meta section for details.'}
is it still due to restriction of Revit CM and/or CWM?
Unfortunately, users cannot create versions:autodesk.bim360:C4RModel type. You must use Revit Cloud Model API to open and sync changes to the central model instead.
Application#OpenDocumentFile Method (ModelPath, OpenOptions, IOpenFromCloudCallback)
Document#SynchronizeWithCentral
However, due to the restriction of Revit CM and/or CWM, you cannot currently use Revit Cloud Model API on DA. Our engineering is still working on it. Please stay tuned with us. But you still can achieve this with Revit Desktop. Here is a sample using the above API: https://github.com/Autodesk-Forge/forge-rcw.file.migration-revit.addon

How to Add File Reference to Quality Issue

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}}"
}
]
}
]

Provide access programmatically to BIM 360 services

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.

Applying Sqlfilter to ServiceBus topic trigger in Azure Function?

So we have a Azure ServiceBus topic triggering a Azure Function. Problem is we need to apply a filter on the subscription. Json looks like this:
"bindings": [
{
"name": "mySbMsg",
"type": "serviceBusTrigger",
"direction": "in",
"topicName": "testtopic",
"subscriptionName": "AllMessages",
"connection": "RootManageSharedAccessKey",
"accessRights": "Manage"
}
Any ideas?
we have a Azure ServiceBus topic triggering a Azure Function. Problem is we need to apply a filter on the subscription.
As far as I know, Azure Functions do not provide a direct way to set up filters for an existing subscription while defining the function bindings and other configuration settings in function.json. If you’d like to apply filters for subscriptions, you could set up filters when you create subscriptions. For more information about creating subscriptions with filters, please refer to this documentation.
You can create a new subscriber with filter using Microsoft.ServiceBus; inside some temporary application (some cloud service or even console application).
When the new subscriber is subscribed, kill it.
Then use the same subscription name in your Function, the events will be filtered.
WindowsAzure.ServiceBus.5.0.0 library, which provides you to create filters for the subscription which is already present.
Alternatively, you can go with tools like Serverless360, Here this will have an option to create filters for Topic Subscriptions.
Refer this blog for more details.

CVE Details API , get vulnerabilities by component

I need to get vulnerabilities by component at JSON format, but all I've get by using CVE Details API just single vulnerabilities where no components or something, only describe.
Here is an example of link
http://www.cvedetails.com/json-feed.php?numrows=10&vendor_id=0&product_id=0&version_id=0&hasexp=0&opec=0&opov=0&opcsrf=0&opfileinc=0&opgpriv=0&opsqli=0&opxss=0&opdirt=0&opmemc=0&ophttprs=0&opbyp=0&opginf=0&opdos=0&orderby=3&cvssscoremin=0
Here is an example of JSON:
{
"cve_id": "CVE-2016-4951",
"cwe_id": "0",
"summary": "The tipc_nl_publ_dump function in net/tipc/socket.c in the Linux kernel through 4.6 does not verify socket existence, which allows local users to cause a denial of service (NULL pointer dereference and system crash) or possibly have unspecified other impact via a dumpit operation.",
"cvss_score": "7.2",
"exploit_count": "0",
"publish_date": "2016-05-23",
"update_date": "2016-05-24",
"url": "http://www.cvedetails.com/cve/CVE-2016-4951/"
}
Are there any way to get vulnerabilities by name of component? (new and old)
Red Hat maintains a CVE API that can be searched by component, e.g.:
https://access.redhat.com/labs/securitydataapi/cve.json?package=kernel&after=2017-02-17
Documentation for the API can be found here.
Note that the data is probably limited to components in Red Hat products.
An alternative to vendor specific CVE API's is CIRCL's Common Vulnerabilities and Exposure Web Interface and API.
Its web interface can be found at https://cve.circl.lu/ and API documentation here https://cve.circl.lu/api/
Bit late for a proper reply, but maybe it'll still be useful. A while back I was a bit frustrated with the options available, so I built https://cveapi.com.
You can call GET https://v1.cveapi.com/.json and get the NIST json response for that CVE back.
It doesn't require any auth and is free to use.