castro nelson
castro nelson

Reputation: 1

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.

Upvotes: 0

Views: 419

Answers (1)

Petr Broz
Petr Broz

Reputation: 9942

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.

Upvotes: 0

Related Questions