3

A friend and I are following the Autodesk Viewer tutorial here: https://developer.autodesk.com/en/docs/viewer/v2/tutorials/basic-viewer/

We've both completed all the previous steps except for the very last of using the APIs POST job endpoint to send a base64 encoded urn off to the Model Derivative API for conversion to a SVF file so that Autodesk's Viewer may use it.

This is what I'm using to send the POST job request:

curl -X 'POST' -H 'Authorization: Bearer cywr9WWu8kml3rQIVnPDohFDsoRl' -H 
'Content-Type: application/json' -v 'https://developer.api.autodesk.com/modelderivative/v2/designdata/job'
-d '{"input": {"urn": "dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6bXl0ZXN0YnVja2V0dGVzdDIvZ2lyaV9zaXJfY29weTEucnZ0"},
"output": {"formats": [{"type": "svf","views": ["2d","3d"]}]}}'

and this is the APIs response:

{"type":"manifest","hasThumbnail":"false","status":"failed","progress":"complete",
"region":"US","urn":"dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6bXl0ZXN0YnVja2V0dGVzdDIvZ2lyaV9zaXJfY29weTEucnZ0",
"derivatives":[{"name":"giri_sir_copy1.rvt","hasThumbnail":"false","status":"failed",
"progress":"complete","messages":[{"type":"error","code":"Revit-InternalError",
"message":"<message>We have encountered some issues while preparing the file for viewing.
Please contact support for assistance.</message>"},{"type":"error",
"message":"Unrecoverable exit code from extractor: -1073741831",
"code":"TranslationWorker-InternalFailure"}],"outputType":"svf"}]}

Any insights is greatly appreciated.

Mikeumus
  • 3,570
  • 9
  • 40
  • 65
  • 1
    this .rvt file open fine on Revit? Seems like it got corrupted somewhere, maybe during the upload? Can yo try the "upload" at http://modelderivative.herokuapp.com/ and viewer? just to make sure the file is really working. – Augusto Goncalves Jun 23 '16 at 15:49
  • Hey @AugustoGoncalves, Thanks for the reply. Yes I was able to upload and view the `rvt file from Autodesk360.com successfully. – Mikeumus Jun 23 '16 at 17:24
  • @AugustoGoncalves, Logging to to "production" in the heroku app asks for permissions but then callback gives this: https://git.io/voMaF – Mikeumus Jun 23 '16 at 17:32
  • as the A360 works fine, I'm suspecting that your file is getting corrupted during the upload... A360 uses the exact same translation pipeline... the sample app on herokuapp should be handling uploads fine, can you try again? (please select "Production") – Augusto Goncalves Jun 23 '16 at 17:35
  • I had to clear my history and cookies but the rvt model is showing in the heroku viewer now. It was giving an "Access-Control-Allow-Origin" error as I was developing using C9: https://git.io/voMiQ – Mikeumus Jun 23 '16 at 18:10
  • excellent, so if is showing on this herokuapp (that uses the same API endpoint as you), then I believe is a problem during your upload... can you share more info on that part? – Augusto Goncalves Jun 23 '16 at 18:12
  • 1
    `POST job` keeps failing. Must be missing something but that's okay I'm just going to model after the heroku sample app. Thanks for sharing that @AugustoGoncalves. – Mikeumus Jun 23 '16 at 19:03

1 Answers1

1

Summarizing the comments on the question: here is the link to the sample running and source code (postJob function).

Please note this sample is storing the file directly under the developer account (OSS), not under the user account (Data Management), it's an important difference! The first uses 2-legged token, the second uses 3-legged token. Data Management contains some abstractions/metadata to organize the files, like hubs, projects and folders, but ultimately stores on OSS. Depending on the way it was stored, you need different tokens/permissions to read/write it.

Augusto Goncalves
  • 8,493
  • 2
  • 17
  • 44