In the terminal run this to install all the necessary components
npm i
You will need to set the value of clientId and clientSecret variables in index.js based on your APS app's credentials and make sure that the Callback URL of the app is set to http://localhost:8080/callback/oauth as shown in the picture

You will also need to set the value of hubName, projectName and componentName variables. You can find them either in Fusion Teams web app, in Fusion 360 or any other place that lets you navigate the contents of your Autodesk hubs and projects - including the Manufacturing Data Model API itself

In a terminal, you can run the test with:
npm start
As instructed in the console, you'll need to open a web browser and navigate to http://localhost:8080 in order to log into your Autodesk account
Open http://localhost:8080 in a web browser in order to log in with your Autodesk account!
Open STEP file from location: file:///Users/nagyad/Documents/GitHub/autodesk-platform-services/aps-fusion-data-samples/5.Generate%20STEP%20file%20for%20Component/geometry.step
Once the STEP file has been downloaded, a link will be provided to it in the console that you can click
The workflow can be achieved following these steps:
- Ask for the STEP file of a specific model based on its hub, project and component name
- If it's not available yet (status is "pending") then keep checking the latest status
- Once the status is "success" you can download the STEP file using the url provided
In app.js file, the following GraphQL query traverses the hub, project and its rootfolder to find the design to generate the STEP file for
query GetGeometry($hubName: String!, $projectName: String!, $componentName: String!) {
hubs(filter:{name:$hubName}) {
results {
projects(filter:{name:$projectName}) {
results {
rootFolder {
items(filter:{name:$componentName}) {
results {
... on Component {
tipVersion {
derivatives (derivativeInput: {outputFormat: STEP, generate: true}) {
expires
signedUrl
status
progress
outputFormat
}
}
}
}
}
}
}
}
}
}
}
Please refer to this page for more details: Manufacturing Data Model API Docs