Shaked Tayeb Shaked Tayeb - 27 days ago 8
Node.js Question

Autodesk Forge API a-401 Error

I'm trying to make a simple forge test work.

I am been using this basic git project:
https://github.com/leefsmp/view.and.data-boilerplate

what i did so far:


  1. i created an account.

  2. implemented the creds in the config file

  3. uploaded a file to models.autodesk.io using my secret key.
    4 i took the udn and passed it into the viewer.js file.

  4. ran npm install

  5. npm run



when i go to the localhost:3000 i still get :

dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6bW9kZWwyMDE2LTExLTExLTEyLTQxLTA3LXlldmJwbHl0Yzkya3Y2cGtqdW10Z2F5ZnJ3dTAvUkEtUy1CdWlsZGluZy5ydnQ:1 GET https://developer.api.autodesk.com/viewingservice/v1/dXJuOmFkc2sub2JqZWN0cz…TEyLTQxLTA3LXlldmJwbHl0Yzkya3Y2cGtqdW10Z2F5ZnJ3dTAvUkEtUy1CdWlsZGluZy5ydnQ 401 (Unauthorized)
viewer.js:210 Access was denied to a network resource (HTTP 403).

The buttons for the load and unload extension are visible.

any ideas what i'm missing here?

Answer

I think you are looking at a deprecated repo, if you want to start with the use of boilerplate samples of the API this is a better option for you.

https://github.com/Autodesk-Forge/forge-boilers.nodejs

Hope it helps. Cheers,