autodeskautodesk-designautomation

Error Creating a Work Item with Autodesk's Design Automation API


I'm trying to setup the POST /workitems endpoint, but when I check the status of my WorkItem after creating it I am consistently running into Failed Instructions with this error message:

{
  "logs":[
    {"message":"Getting token","timestamp":1748973157,"type":"System","level":"Info"},
    {"message":"6: TASK_ERRORCODE_BEARER_TOKEN_GENERATION_FAILURE: The request is missing a required parameter\u0027subject_token\u0027.",
      "timestamp":638845699575041547,"type":"System","level":"Error"}
  ],
  "result":""
}

I tried creating an Activity, zip file, and App Bundle that matches the tutorial. I also tried creating a simple Activity and App Bundle that takes in 0 arguments. However, I am still running into the same error as above.


Solution

  • The request requires a valid "PersonalAccessToken" in its body

    {
       "activityId":"<your_activity_id>",
        "arguments": {
            "PersonalAccessToken": "<your_personal_access_token>",
            "TaskScript": "adsk.log('foobar')"
        }
    }
    

    An empty or invalid PAT causes errors.

    To generate your PAT follow that tutorial:

    https://aps.autodesk.com/en/docs/insights/v1/developers_guide/authentication/personal-access-token/

    And make sure to select "Design Automation for Fusion" when generating the PAT, like that