Getting notified when user run Forge application - autodesk-forge

to analysis who is using Forge app and how often is used, is it doable to get notified i.e. user (email) when login (BIM 360 hub) via autodesk account, and notify to (hardcoded) email, preferably email of developer (registered w/ forge app portal)? code sample or snippet will be very much appreciated, thanks.

Forge itself does not provide any notification mechanism for this, but if you're developing your own Forge application, you could easily issue the notifications whenever your application receives a callback from the 3-legged OAuth workflow. For example, if you were following this Learn Forge tutorial: https://learnforge.autodesk.io/#/tutorials/viewhubmodels using .NET, you could modify the following controller method: https://github.com/Autodesk-Forge/learn.forge.viewhubmodels/blob/net/forgesample/Controllers/OAuthController.cs#L93-L103, to notify whoever needs to be notified.

Related

problem : Azure Logic App is not visible in Azure API management

I am facing one issue. I am not able to find logic app in API management application.
I am 10 different workflows with HTTP trigger. Through Postman, they are working fine.
Both apps (logic app and API management app) are under same subscription and resource group. but when I am searching logic app it is not visible.
In API management ->backend, I am able to find it but not sure how to connect back-end with Front end in this approach.
please help
I've had the same and it took me a while to find out that the Logic App also needs to run under a "consumption plan":
https://learn.microsoft.com/en-us/azure/api-management/import-logic-app-as-api#prerequisites
When creating the Logic App you can chose between a Standard or Consuption plan.
Similar problem. I have a Logic App workflow defined as:
And yet this logic app does not show up when I attempt to import it into API Management:
The Logic App and API Management instances are in the same account and resource group.

Forge - Direction of Model Derivative API

The Forge documentation mentions “If you need an end user to authorize your app to act on the user’s behalf, you’ll want to check out this tutorial.” This makes it sound as if our app will be doing something from OurApp → Forge, reaching into Fusion data, pulling it out. Our desired action would be the user acting on their own behalf, with authorized permission, sending files to their account on OurApp.
I've genericized it, but our specific situation is as follows: we want Fusion360 users to be able to install our plugin and then send models in STL format (model derivative v2 API) to our service for 3D Printing or sharing with others. This same behavior exists for Tinkercad and is very popular, but the requirements change for Fusion, now that it is not a web app like Tinkercad.
Autodesk Forge uses OAuth 2.0 as its authentication strategy, and as part of that, the platform allows you to choose between two-legged and three-legged authentication.
Two-legged authentication means that a trust is established between your own application (with credentials that are generated for you when you create a Forge app on https://forge.autodesk.com) and the Forge services. Your application can manage its own data but it does not have access to your users data in other Forge applications.
Three-legged authentication means that a trust is established among 3 entities: your application, Forge, and your user. With an access token generated using 3-legged authentication, your application can also access the user's content in other Forge applications, for example, in BIM360 or Fusion Teams.
With that, if you plan on having your users upload STL files from a locally running instance of Fusion 360, you can use the simple 2-legged authentication and have your Forge application own and manage the uploaded data and the translated derivatives. But if you wanted to upload or download STLs to/from something like Fusion Teams, you would need the 3-legged auth workflow.

Create persistend access to the viewer

I'm not really familiar with Autodesk's instruments, so maybe anyone could help me with Auth:
I have 2-legged auth with forge, and i need to refresh token automatically or simply make my viewer persistent.
Also any help/links/references on points of interest or how to add floor switching feature to the project?
Typically, when setting up the viewer, you provide a function the viewer will call whenever it needs a fresh 2-legged token. This function should make a request to your server-side logic to generate the new token. The Learn Forge - View Your Models tutorial guides you through this process, using different languages and runtimes. For example, here's how you could implement the token updating in Node.js:
https://github.com/Autodesk-Forge/learn.forge.viewmodels/blob/nodejs/routes/oauth.js#L26-L36
https://github.com/Autodesk-Forge/learn.forge.viewmodels/blob/nodejs/public/js/ForgeViewer.js#L46-L52
Btw. a "refresh token" is only available in 3-legged auth workflows.
For features like floor switching, take a look at these:
https://forge.autodesk.com/blog/view-each-floor-using-vertical-explode
https://twitter.com/ipetrbroz/status/1227901732023201795

Scripted Authentication for Autodesk Forge TokenFlex API

This question pertains to the Autodesk Forge TokenFlex Usage API. We would like to run an application that pulls data on a scheduled basis. Our understanding is that the Forge TokenFlex API requires 3 Legged authentication. We have successfully adapted the Autodesk GitHub code sample "A Forge Python Script Demonstrating new TokenFlex Usage API" to pull our data but this requires 3-Legged Authentication.
Is there a way to pull data using the TokenFlex Usage API without requiring user intervention for Authentication?
Unfortunately TokenFlex requires 3 legged auth for enhanced security purposes.
However you can minimize user intervention but rotating the token periodically in your backend using the refresh_token that comes with the token to get refreshed tokens implicitly and store them securely (encryption recommended for security reasons) where your script can use them, see here for details

Autodesk API Forge Authentication Bearer

I'm the administrator of a Bim360 Docs Hub,and i'm trying to retrieve some data from the forge API. I've already created a test app, and i get a Bim 360 Account Id.
I'm not able to get an authentication bearear token (OAuth), to make simple get requests towards projects.
Where do i get the auth token ?
Thanks
See tutorial here to aquire OAuth tokens and note that you will need different permutations of OAuth scopes (esp. data:read data:write etc.) for different operations, as is specified in the docs of each and every API, see an example here.
You may use a RESTful client like Postman to talk to our APIs and manage the authentication flow and operate on response data with JavaScript as you like so as to build workflows such as to create a new project.
Last but not least before you can access BIM360 APIs make sure you provision access to your app.