Getting 404 Error While fetching MetaData of BIM360 Model using Forge SDK API - autodesk-forge

i am trying to get Model Strucuture data of BIM360 Model That we store, for that i'm using metadata api passing threelegged Token, model urn, model guid, but getting 404 (Not Found Error). i tried for get model that we store in our bucket that we are getting from this api, but that model we stored in BIM360 Accounts for that API is giving Error of NOT Found,
i have passed all scope, backet:read, data:Read etc. couldn't getting result.
Thank you

It's a bit difficult to guess what's wrong with the limited information but generally, the 404 Not Found error would indicate that something in the URL (of the request made by the derivativesApi.getModelviewMetadata method call) is missing or wrong.
I'd suggest to look at the following:
Could you take the URN, GUID, and access token, and make the request to the GET {urn}/metadata/{guid} endpoint directly using some 3rd party client application such as curl or postman?
If this returns 404, there might be some issue with the actual URN and/or GUID
If this works, there might be some issue in your code
What Forge SDK exactly are you using, and for what language? Is it one of the official SDKs, or is it a 3rd party one?
Are you sure you're passing in the right parameters to the derivativesApi.getModelviewMetadata method call?

Related

Service to service authentication is not allowed using forge Autodesk

In 'Autodesk Construction Cloud APIs' I try to use GET method for projects/{projectId}/issues.
This is the documentation for the API: Get issues API Link
I am using Postman and for other API's it works without problems, but for some reason for this API I got the following error:
image of the error:
I know my ProjectId and Token are fine. I am wondering if it has to do with some access the admin must to give me.
best regards,
It looks like your access token is 2-legged. Instead, you will need to use a 3-legged one since its Authentication Context is user context required.
See:
https://forge.autodesk.com/en/docs/oauth/v2/developers_guide/basics/
https://forge.autodesk.com/en/docs/oauth/v2/tutorials/get-3-legged-token/
https://forge.autodesk.com/en/docs/oauth/v2/tutorials/get-3-legged-token-implicit/

403 Unauthorized error to derivative service Autodesk Forge (Viewer not showing)

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.

How to read all data using Revit API?

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.

Create Signed URL for Object in BIM360 OSS

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.

Inconsistent response from REST API when hosted on WSO2 API Manager 2.1

We have a REST API hosted on WSO2 API Manager. When calling the API through WSO2, it sometimes returns the correct response, other times gives an error that the json object received is invalid. The log file shows that the json request object is not being submitted to the API at all.
Can anyone help out on how to resolve or troubleshoot this issue?
I don't see any errors in the product log. The only difference I can see is the Activity Id is different in 2 requests, and it results in different responses.