Missing methods in Forge ACC API? - autodesk-forge

Looking at the forge API documentation for ACC, I see that they don't support forward Compatibility from BIM360 for many key account admin methods, specifically: POST projects, POST projects/:project_id/users/import (v2).
Yet I also don't see new methods for those operations (create a new project, add users to a project).
Am I missing something or is there no public API for those operations in ACC, and if not when do you think a public API for those operations will be available?
Thank you,

Currently POST projects, POST projects/:project_id/users/import (v2) are not supported for ACC.
Though you can take a look at Autodesk Construction Cloud API updates and see what's in the pipeline.

Related

What's the difference between admin.b360 and developer.api Autodesk's services?

I'm trying to implement Forge API endpoints wrapper and I faced with situation, where I can create user via this endpoint https://developer.api.autodesk.com/hq/v1/accounts/:account_id/users but I can't find endpoint for removing users (not inactivation). I found that for user deleting WebUI of BIM360 actually using https://admin.b360.eu.autodesk.com/users/:user_id/destroy endpoint, but I can't find description of this endpoint anywhere. What's the difference between developer's API and admon.b360 stuff?
I cannot find that endpoint on our API documentation. If you only see it under the dev tools, it could be an internal endpoint of the BIM360 services that can only be accessed by BIM360 itself.
Commonly, user-accessible BIM360 APIs are exposed under the base URL https://developer.api.autodesk.com/. If you don't see it listed on the Forge BIM360 API documentation, it means the function you're looking for is not available at this moment, unfortunately.
https://forge.autodesk.com/en/docs/bim360/v1/reference/http/

Google map API key credential additional methods

I have received a Google Map API Key and it seems to work just fine. Looking on the credential page of the GCP I see there are some alternate methods that I don't see documented anywhere. I have attached a screen shot of the specific page I am referring to, but I was wondering if anyone could give me insight on how to use these methods (OAuth and Service Accounts) or where I might find more documentation.
Thank you.
OAuth 2.0 Client IDs and Service Accounts may not be needed for Google Maps APIs. You will only need API keys to authenticate Google Maps APIs requests as explained here, so I think you can ignore the others.
But to give you an insights, as per the documentation here:
OAuths 2.0 Client IDs are used to allow your apps to access other Google Cloud products on behalf of the user.
Service Accounts are accounts that used by an app to make authorized API calls for other Google Cloud products. You can learn more here: https://cloud.google.com/iam/docs/service-accounts

Autodesk Forge Document Approve Status

We are using Autodesk BIM360 Docs to manage our drawings, and as well review workflows are used in our project. Now we get a request to use Forge API to copy files that are approved to our local storage. Everything seems good except that we cannot find a forge API with which we can get the approve status of each document.
Any help would be appreciated.
I'm sorry to say that there is no API available to fetch approve status currently. Please keep your eyes on Forge blog announcements and BIM360 roadmap for updating. Once it gets supported we will post here. Thanks!

Initiate BIM360 Docs collaboration programmatically

In order to upgrade to the current version of Revit, we have to migrate our files from from BIM360 Teams to BIM360 Docs. Since we have hundreds of documents, I am looking to automate this process as much as possible.
The forge API allows me to download all Revit files from BIM360 Teams. I am also able to upgrade them all to Revit 2019, using either the Revit API or a third party app such as this Bulk File Upgrader`.
Using the Forge BIM360 API, I am able to create new projects programmatically, and upload the files and folders from the Team Drive. The step that I am having difficulty accomplishing in an automated fashion is to initiate collaboration for the upgraded Revit 2019 files. Is there a way that this can be accomplished with either the Revit API or the Forge API? Or is there another way that allows me to automatically accomplish the migration between these two Autodesk Cloud Collaboration solutions?
I came across this tutorial on publishing models, which suggests that one needs to manually initiate collaboration for each Revit file through the Revit UI. I hope to find an alternative solution to this suggestion.
Thank you!
My colleague Eason Kang 康益昇 confirmed that you can use the steps provided in my previous answer to achieve this as follows:
Revit 2019.2 and future releases include support for the "Single user workflow", the non-workshared cloud model. At the same time, they expose the API to initiate the non-workshared cloud model and convert the non-workshared cloud model to a workshared cloud model (C4R).
You can use the single user APIs to workaround the cases you mentioned as follows:
Save the downloaded files and non-workshared files to your local file system.
Initiate non-workshared cloud model through the API call to Document.SaveAsCloudModel.
Convert it to a C4R model via the API Document.EnableCloudWorksharing.
Here is his report, including the solution to a credentials issue on the way:
Question: I would like to save a local RVT to my BIM360 account – with Design Collaboration service activated – using the Revit 2020 API, but Revit always throws an exception saying that I do not have the access rights. I have a valid C4R license and able to open C4R models from the folder id I passed to the API with the Revit UI. What is missing?
Code:
doc.SaveAsCloudModel(
"urn:adsk.wipprod:fs.folder:co.8rtX03jDQXKnssA1FfrEXw",
doc.Title);
Exception:
Autodesk.Revit.Exceptions.RevitServerUnauthorizedException: You do not have cloud model entitlement to access this resource in cloud
Answer: You need to have the 'Cloud Models for Revit' entitlement set up in manage.autodesk.com.
Response: Thank you for clarifying. I confused the 'Cloud Models for Revit' with the C4R, and I didn't have the 'Cloud Models for Revit' entitlement set up in my manage.autodesk.com.
Answer: 'Cloud Models for Revit' is a new service provided since Revit 2019.2. It is part of the Revit and Revit LT subscription.
Btw, the major difference to the C4R models is thaT only one user at a time can work on the model created by this method.
Response: Great!
I set up my Revit Subscription as required, followed the steps shared above by Jeremy and confirmed that it works!
You can achieve the goal through the Revit API using the following steps:
Initiate a non-workshared cloud model through the API call to Document.SaveAsCloudModel.
Convert it to a C4R model via the API Document.EnableCloudWorksharing.
Here is my test code implementing this:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Autodesk.Revit.ApplicationServices;
using Autodesk.Revit.Attributes;
using Autodesk.Revit.DB;
using Autodesk.Revit.UI;
using Autodesk.Revit.UI.Selection;
namespace adsk.c4r
{
[Transaction(TransactionMode.Manual)]
public class Command : IExternalCommand
{
public Result Execute(
ExternalCommandData commandData,
ref string message,
ElementSet elements)
{
UIApplication uiapp = commandData.Application;
UIDocument uidoc = uiapp.ActiveUIDocument;
Application app = uiapp.Application;
string template = app.DefaultProjectTemplate;
string filename = #"D:\DevZone\ADN\t5021\revit_api_c4r_test_6.rvt";
string name = System.IO.Path.GetFileName(filename);
Document doc = app.NewProjectDocument(template);
doc.SaveAs(filename);
try
{
doc.SaveAsCloudModel(
"urn:adsk.wipprod:fs.folder:co.aCd1tMmrTxucmJcmtYTLBQ",
name);
var cloudPath = doc.GetCloudModelPath();
if(doc.CanEnableCloudWorksharing())
{
doc.EnableCloudWorksharing();
}
TaskDialog.Show("Revit",
string.Format("{0} is a C4R model now", name));
doc.Close();
uiapp.OpenAndActivateDocument(cloudPath, new OpenOptions(), false);
}
catch(Exception ex)
{
System.Diagnostics.Trace.WriteLine(ex.Message);
return Result.Cancelled;
}
return Result.Succeeded;
}
}
}
Sorry for the delay answering this.
This issue sounds similar to the one raised in the Revit API discussion forum and escalated to the ADN case 14906646 Old topic brought back - changing link paths to Cloud paths.
We have raised the question with the Revit, C4R, Forge and Desktop Connector development teams, causing lively discussion with no clear answer yet in sight.
We are researching as hard and fast as possible and will provide a more conclusive answer asap.
The development team are still discussing this issue. Meanwhile, they also said:
This request is recorded in the development issue REVIT-140793.
There may be a workaround to achieve what you need.
Revit 2019.2 and future releases include support for the "Single user workflow" -- that is the non-workshared cloud model. At the same time, they expose the API to initiate the non-workshared cloud model and convert the non-workshared cloud model to a workshared cloud model (C4R).
So, I think you can use the single user APIs to workaround the cases you mentioned as follows:
Save the downloaded files and non-workshared files (local files).
Initiate non-workshared cloud model through the API call to Document.SaveAsCloudModel.
Convert it to a C4R model via the API Document.EnableCloudWorksharing.
Autodesk has also recently published a GitHub repository with a solution for this exact scenario. You can find the video here which talk about this. This basically uses enhanced api calls in Revit 2022 API - RevitLinkType.Create & RevitLinkType.LoadFrom which support cloud model creation and linking.
There's a related question about how to create new cloud models using Revit API.

Migrating to Drive SDK from DocumentsList API V3

I just came to know that DocumentsList API is depricated. So i thought of migrating my app to Drive and saw this page. I mostly use urls like https://docs.google.com/feeds/default/private/full/. So is it enough to replace them with new URL's like this https://www.googleapis.com/drive/v2/files/ ?
Just wanted to confirm is that all i need to takecare or am I missing anything. My App uses OAuth2 for authorization. Do I need to change anything in there too?
If you are constructing the requests yourself, you have to replace the URLs but also take into account that the responses from the Drive API will be JSON-formatted and not XML-formatted as in the Documents List API.
If instead you are using one of the Google-provided client libraries, you have to start using a newer client library, that you can download from https://developers.google.com/drive/downloads.
The migration guide is mostly a guide that maps methods from the Documents List API into methods of the Drive API and should be used as reference to know what is available and where.
Oauth 2.0 is fine. You can even use the same tokens you already have for Documents List v3.