Derivatives API not returning Properties.db file - autodesk-forge

We have seen few times that the properties.db file is coming with the converted model when using the derivative APIs.
I also tried the extract node module and the zip file does not contain properties.db too.
is there any change in the api for retrieving that file?
regards,
Afshin

Unfortunately there's no specific API dedicated to retrieve the property DB file.
You can get its path by looking up the manifest after the model is completed extracted/translated and download it from there using the GET :urn/manifest/:derivativeurn endpoint:
{
"guid": "...",
"type": "resource",
"urn": "urn:adsk.viewing:fs.file:<urn>/output/properties.db",
"role": "Autodesk.CloudPlatform.PropertyDatabase",
"mime": "application/autodesk-db",
"status": "success"
},
In case it's not generated let us know the URN by dropping a line to forge.help at autodesk.com so we can look into it.

Related

Autodesk Forge - refPoint info in SQLLite db

I have 3 revit models on BIM360 and I want to view them in a Forge Viewer.
To do this, I aggregated the 3 models with the information provided at this link Revit shared coordinates to Forge viewer, and everything is OK.
I want to know if is possibile to get refPoint information in the model's SQLLite db (https://forge.autodesk.com/blog/accessing-design-metadata-without-viewer)
Is it possible?
TIA
Alder
Unfortunately, the refPoint data is extracted into AEC Model Data only. It's a JSON file. You can get see it in the model manifest via calling GET :urn/manifest and download it by using GET {urn}/manifest/{derivativeurn}
{
"urn": "urn:adsk.viewing:fs.file:dXJuOmFkc2sud2lwcH....x/output/Resource/AECModelData.json",
"role": "Autodesk.AEC.ModelData",
"mime": "application/json",
"guid": "a4aac952-a3f4-031c-4113-b2d9ac2d0de6",
"type": "resource",
"status": "success"
},
ref: https://forge.autodesk.com/blog/consume-aec-data-which-are-model-derivative-api

Download a Document with Autodesk API

I'm trying to download documents from BIM 360 Docs. If I want to download a file with the type "type": "items:autodesk.bim360:File" I just need to get the bucketID and objectID (/projects/<projectID>/items/<itemID>) and call buckets/<bucketID>/objects/<ObjectID>. (I used this tutorial)
But how do I download a file with the type "type": "items:autodesk.bim360:Document"?
First, I get the version of the document /projects/<projectID>/items/<itemID>/versions. After that I call projects/<ProjectID>/versions/<versionID>/downloadFormats but it returns an empty JSON. The call projects/<ProjectID>/versions/<versionID>/downloads returns a 400 Bad Input. Whats the right way to get the bucket & objectID from a "document"? The way from the tutorial doesn't work because there is no "storage" tag in the JSON (example).
For BIM 360 Project Folder items, follow the tutorial here to download document.
Basically you will need to obtain the URN of the document from the relationships.storage.data.id field via GET projects/:project_id/folders/:folder_id/contents.
For item type items:autodesk.bim360:Document, call GET projects/:project_id/versions/:version_id/relationships/refs to obtain the storage locations:
"storage": {
"meta": {
"link": {
"href": "/oss/v2/buckets/wipbucket/objects/urn:adsk.objects:os.object:wip.dm.prod%2F9f8bdc3f-e29c-4ada-ab7b-bb8dfa821163.pdf"
}
}
See doc here.

Forge - Revit-UnsupportedFileType

I’m trying to integrate Forge viewer with my sample application and facing some issues.
Below are the steps I tried to achieve my goal.
Registered an app by creating a new account and generated “client ID” and “secret key” (success).
Generate Oauth token for further API calls (success).
Create a new bucket storage (success).
Upload model to the bucket and create URN for the model (success).
Design data for model translation (this is the step where our uploaded model will be translated to SVF) (success).
Check status of translated file. (success response but with error message as given below).
"messages":
[
{
"type": "error",
"code": "Revit-UnsupportedFileType",
"message": "The file is not a Revit file or is not a supported version."
},
{
"type": "error",
"message": "Possibly recoverable warning exit code from extractor: -536870935",
"code": "TranslationWorker-RecoverableInternalFailure"
}
],
Any help would be highly appreciated.
Are you able to upload & view the file using the public viewer? If so, most likely your upload routine (step 4) is corrupting the file. In this case, are you using resumable upload?
Samples for resumable upload:
C#
Nodejs

Handling Extra JSON Tags sent from Google App Engine API

I am trying to figure out the best way to handle extra JSON returned on a 200 Success from Google App Engine.
Here is a sample of the JSON being returned from GAE
{
"username": "yo",
"password": "yo",
"email": "yo",
"id": "5654313976201216",
"kind": "photoswap#userItem",
"etag": "\"XUjxKcsckN9zXROpZ4Yj2GJxcXg/L6Zg-XPyGcr_RGBFQBwHhIYcdBQ\""
}
This does not work with the User Model that I have developed, and was causing issues because of the gson json mapping. The fields "kind" and "etag" are not part of the response message that I created, and was wondering if there is a way to remove that from being sent back from the server.
The api I have developed is written in Python
As of right now I just included those 2 values in my User Object Model, but I would like to not have to.

Accessing Google AppEngine Cloud Endpoints using ActionScript 3?

Is anyone aware of method of accessing Google AppEngine Cloud Enpoints using ActionScript 3 without having to go through the JavaScript layer? I have been going on the docs and Google to find any tutorials or examples but did not find anything useful.
We don't have AS3 client libraries and currently there are none planned that I know of, so you'll have to rely on HTTP to make your REST calls.
TLDR; Use the APIs Explorer
If you visit
https://your-app-id.appspot.com/_ah/api/explorer
(replacing your-app-id with your actual application ID), then you'll be redirected to your own custom version of the Google APIs Explorer.
In it you can click on individual APIs and see the list of all available methods. Within a the page for each method, you can try out forming requests and the Explorer will suggest the correct values to use.
After you click "Execute", the full HTTP request (headers and all) and response will be printed on your page, which will show you which commands to use.
Description of how to use the Discovery Document
The Discovery Document for your API will contain all the information you need to construct a request.
To find the root for calling your API, check out the baseUrl key. It should be something like:
https://your-app-id.appspot.com/_ah/api/tictactoe/v1/
To figure out how to call a specific method, there are descriptions of every method, nested down as resources in the Discovery Document. For example, for the Tic Tac Toe Python sample, the board_get_move method has a name of board.getmove in the #endpoints.api decorator. This means the method getmove is owned by the resource board.
If you look in the resources.board.methods key in the Discovery Document you can see the getmove method:
"getmove": {
"id": "tictactoe.board.getmove",
"path": "board",
"httpMethod": "POST",
"description": "Exposes...",
"request": {
"$ref": "TictactoeApiMessagesBoardMessage"
},
"response": {
"$ref": "TictactoeApiMessagesBoardMessage"
}
}
Combining the path with our baseUrl we know requests will need to be sent to
https://your-app-id.appspot.com/_ah/api/tictactoe/v1/board
and from httpMethod we know requests will use the HTTP method POST.
Finally, to specify the request, we see a reference to a schema:
"$ref": "TictactoeApiMessagesBoardMessage"
Looking in the schemas.TictactoeApiMessagesBoardMessage key in the Discovery Document we see:
"TictactoeApiMessagesBoardMessage": {
"id": "TictactoeApiMessagesBoardMessage",
"type": "object",
"description": "ProtoRPC message definition to represent a board.",
"properties": {
"state": {
"type": "string"
}
}
}
so we know the payload must contain a single field called state and that field must be a string.