0

When following the steps described here: https://forge.autodesk.com/en/docs/design-automation/v3/tutorials/revit/step4-publish-appbundle/#step-3-upload-the-appbundle I get an Aws specific error.

<Error><Code>AccessDenied</Code><Message>No AWSAccessKey was presented.</Message>

I have verified my request but it seems that both the header and all form data has been set correctly, as described in this example:

curl -X POST \
  https://dasprod-store.s3.amazonaws.com \
  -H 'Cache-Control: no-cache' \
  -F key=apps/Revit/DeleteWallsApp/1 \
  -F content-type=application/octet-stream \
  -F policy=eyJleHBpcmF0aW9uIjoiMjAxOC... (truncated) \
  -F success_action_status=200 \
  -F success_action_redirect= \
  -F x-amz-signature=6c68268e23ecb8452... (truncated) \
  -F x-amz-credential=ASIAQ2W... (truncated) \
  -F x-amz-algorithm=AWS4-HMAC-SHA256 \
  -F x-amz-date=20180810... (truncated) \
  -F x-amz-server-side-encryption=AES256 \
  -F 'x-amz-security-token=FQoGZXIvYXdzEPj//////////wEaDHavu... (truncated)' \
  -F 'file=@path/to/your/app/zip'

Of course, all values have been replaced with the response received from

curl -X POST \
  https://developer.api.autodesk.com/da/us-east/v3/appbundles \
  -H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
  "id": "DeleteWallsApp",
  "engine": "Autodesk.Revit+2018",
  "description": "Delete Walls AppBundle based on Revit 2018"
}'

Now, since this is an AWS specific error, maybe there have been some changes to the AWS api and are the examples given in the forge documentation not up to date?

Augusto Goncalves
  • 8,493
  • 2
  • 17
  • 44
KenGey
  • 406
  • 4
  • 15

2 Answers2

2

This seemed to be a client issue.

I am using the request npm package in node.js and did set the formData as part of the form attribute, instead of the formData attribute.

const request = require('request-promise');

return request.post(uploadParameters.endpointURL, {
  headers: {
   'Content-Type': 'multipart/form-data',
   'Cache-Control': 'no-cache'
  },
  formData: { // use formData instead of form
   ...uploadParameters.formData,
   file: fs.createReadStream(EXPECTED_APPBUNDLE_PATH)
  }
})

KenGey
  • 406
  • 4
  • 15
1

Glad you figured out what was going on :)

If you want a nodejs sample/example for Design Automation, you can take a look at this repository. Even tough it has been built for 3ds Max, the Design Automation concepts are still the same.

https://github.com/Autodesk-Forge/design.automation.3dsmax-nodejs-basic/blob/master/createAndUploadApp.js

Hopefully, something in there can be useful to you.

Jeremy
  • 357
  • 1
  • 6