I was working with a forge viewer for past few weeks.It was fine and I've developed 2 extensions for it and now the application has been shaped well.It's been a while I've looked at the viewer and all of a sudden I'm unable to work with the viewer.The same code working before was not working now.
I can see some changes in documentation stuffs of autodesk forge viewer.Is there any breaking changes.I've been following previous documentation of model-derivative api for preparing file for the viewer.
If I try to run the viewer,I'm getting this error.
Failed fetching Forge manifest
I'll attach a screenshot of the networks tab result,
https://i.stack.imgur.com/lG7VA.png
Similarly when I try to run fetch using postman with this end point,
https://developer.api.autodesk.com/modelderivative/v2/designdata/:urn/manifest
I'm getting,
{
"developerMessage": "Token scope not set. This request does not have the required privilege.",
"moreInfo": "https://forge.autodesk.com/en/docs/oauth/v2/developers_guide/error_handling/",
"errorCode": "AUTH-010"
}
But this was working before.For this endpoint, setting scope is optional as per the documentation.I've tried the same before, it worked.
I'll leave the documentation for your reference
https://forge.autodesk.com/en/docs/model-derivative/v2/reference/http/urn-manifest-GET/
What am I doing wrong?Anything essential I've missed or any breaking changes.I was confused because I'm getting the same response even with a basic viewer code(simplifying all my extra extension logics).
Per our documentation it is the user context that is optional and not oauth scopes - the following scopes have always been required to access the manifest:
Required OAuth Scopes
data:readorviewables:read
If you could access this endpoint with no scopes specified then it was an oversight on our part and must have been fixed now ...
Related
I have just followed the tutorial video here:
https://www.youtube.com/watch?v=QOm0dHgwvbM
And after starting a trial on a newly-activated Forge account, have I thought followed every step in the .NET instructions to the letter.
However, when I run the application, and attempt to upload a file, I receive the following error on the Console:
An unhandled exception has occurred while executing the request.
Autodesk.Forge.Client.ApiException: Error calling GetManifest: { "developerMessage":"The client_id specified does not have access to the api product", "moreInfo": "https://forge.autodesk.com/en/docs/oauth/v2/developers_guide/error_handling/", "errorCode": "AUTH-001"}
Does anyone have any suggestions on how to remedy this?
Thanks,
Alex.
Did you select the Model Derivative API while creating an app in https://forge.autodesk.com/myapps? If not, please go there, then edit the app, select Model Derivative API, and save the change. Afterward, restart your .NET app to fetch a new access token.
ref: https://petrbroz.github.io/forge-samples-docs/#provision-access-in-other-products
So, it turns out my issue stemmed from having previously setup a FORGE_CLIENT_ID and FORGE_CLIENT_SECRET system variables on a previous, unsuccessful trial of Forge. This meant that the Visual Studio solution I created was reading those values instead of the ones I had input in code. Thanks to Cyrille Fauvel of Autodesk for helping me figure this out.
Cyrille says he is going to feed back to the rest of the Forge team that they ought to report back on the console the details of both ID and SECRET to prevent this happening in future.
I am currently working on a project using the Autodesk Forge platform. I have been using the Viewer, Model Derivative, and Data Management APIs without any issues since yesterday that suddenly when I tried to open a model (uploaded weeks ago) and returned a 403 error on requests to view the model.
I did some research with Postman and I tried to do the same calls I'm doing in my app with the same credentials. The OAuth API and Data Management API seem to work correctly because they let me have access to the token and upload a model. The problem seems to be when I try to translate the uploaded model.
The call I'm using in Postman is:
https://developer.api.autodesk.com/modelderivative/v2/designdata/job
And what Postman is returning is:
403 Unauthorized.
{
"developerMessage": "The client_id specified does not have access to the api product",
"moreInfo":"https://forge.autodesk.com/en/docs/oauth/v2/developers_guide/error_handling/",
"errorCode": "AUTH-001"
}
Something similar happens when I try to open a model in my app.
The Request URL is the next one: https://developer.api.autodesk.com/derivativeservice/v2/manifest/{urn}?domain=http%3A%2F%2Flocalhost%3A8080
And the returned code is 403 Unauthorized.
These are the headers in the call:
Headers
The codebase hasn't changed in weeks and exhibits the same behavior leading me to believe it's a code change in the referenced Autodesk Forge libraries or a service issue on the derivative or viewer service.
I can upload cut-up code if required.
Thank you.
we are generated client id and secret id. And also we have got access token using Internal Token.
when running the project we can view Revit file which we are uploaded using forge bucket.
Then again are trying to get all elelments (Building,floor,rooms,equipments etc)in Revit model using API.
using this Link:https://forge.autodesk.com/en/docs/model-derivative/v2/reference/http/urn-metadata-GET/
we have using API in onDocumentLoadSuccess this event.
we are passing url:https://developer.api.autodesk.com/modelderivative/v2/designdata/:urn/metadata
headers :'Authorization': 'Bearer ' + access_token.
In this we are passing urn,access_token parameters also fine.
But we face "Token does not have the privilege for this request" error.(we have already have access token through API.But for the second time we face the error)
How to solve this, please help me on this.
Note that the different endpoints provided by the Forge services require a specific "scope" that the access token must be generated for. For example, according to the GET :urn/metadata docs, this endpoint requires the the access token to be generated with the "data:read" scope.
Also, note that properties of a design processed by the Model Derivative service are actually obtained by a different endpoint - not using GET :urn/metadata, but using GET :urn/metadata/:guid/properties.
I am making a gmail addon in which i am trying to get the user's contact groups (labels) using the code:
var groups = ContactsApp.getContactGroups();
I already have added required scope : https://www.google.com/m8/feeds in manifest file (appsscript.json) but it returns "Exception: Unexpected error while getting the method or property getContactGroups on object ContactsApp". This method was working fine when it was a default apps script project. I started getting this expection after linking my apps script project with Google cloud project. I am also using People API in my project. When I add https://www.google.com/m8/feeds in scopes on consent screen of Google cloud platform it does
not show up there. Instead, https://www.googleapis.com/auth/contacts is shown in the scopes list. It might be because I am using People api and both of these scopes are for read/write user's contacts. And My consent screen on Google cloud platform is still under verification.
Also,I am not able to use any of the methods provived by ContactsApp class. I am getting the same exception when I used var contact = ContactsApp.getContact("abc#gmail.com");
Any help would be appreciated.
Thanks
When changing from a default Apps Script project to a GCP project, you need to enable the necessary APIs in your GCP console
In your particular case you need to enable the Contacts API in your GCP console - for the chosen project
Depending on the rest of your code, you might need to enable also other APIs (e.g. Gmail)
Follow those instructions to enable the requested APIs
I'm trying to set up an Signed URL for an Design Automation Workflow which is triggered by an Webhook inside of the BIM360 OSS. If a file is added the webhooks triggers an endpoint to start a Design Automation. The webhook is working. And the Design Automation is working too. The Problem occurs if i try to wire both up. I#m trying to create a Signed URL of the File like suggested in this post from Petr Broz link stackoverflow.
To use this API it is requierd to use an Token which is obatined by 2-Legged-Auth which is working with all necessary Scopes. In the response of the Webhook is an ID for the Folder and Version. The API is recognizing the ID.
The problem occurs in the response of this endpoint to create the signed url: https://developer.api.autodesk.com/oss/v2/buckets/:bucketKey/objects/:objectKey/signed
I'm using the wip.dm.emea as bucket because the file is stored in the EU BIM360 OSS.
The response is a 403 Forbidden:
{
"reason": "Only the bucket creator is allowed to access this api."
}
Is it even possible to get the File ID like in this example Forge how to Download File ?
Because this Solution requires a 3-Legged-Auth Flow which is not possible for a complete Automation.
The thing which makes me question is, that you can achieve this Workflow in plane Forge. But not in BIM360 where i have no control over the Buckets that are created by the System!?
I think this is an architectural missmatch between the Forge API and the BIM360 implementation!? Will there be a solution for this in the future?
Best regards
Jan
Unfortunately, I can confirm that it's not possible to create a signed URL for your BIM360 storage currently, as the error message mentioned, the endpoint requires the bucket owner to do this operation, this is what it is now. But I agree with you that this should be an architecture mismatch between Forge OSS and BIM360 implementation, and it's already been requested in our system, please keep "CPOSS-1066" to check with us about the progress.
As for the current way, you can keep the 3 legged token and using that for the output Url and also in the onComplete() callback, I have the blog post https://forge.autodesk.com/blog/upload-your-design-automation-output-file-bim360-docs which details the way to work, hope it helps at this moment.