1

I'm using the Autodesk Forge API to convert a range of models from various formats into SVF files, and trying to use the Webhooks API to listen for transformation complete events for jobs posted to the Model Derivative service.

I have successfully created the webhook, and verified its existence by calling the get Hooks API endpoint. Below is the basic response i receive.

        {
            "hookId": "<my-hook-id>",
            "tenant": "<my tennant>",
            "callbackUrl": "<ngrok url>",
            "createdBy": "...",
            "event": "extraction.finished",
            "createdDate": "2020-11-05T05:48:39.016+0000",
            "system": "derivative",
            "creatorType": "Application",
            "status": "active",
            "scope": {
                "workflow": "<my-workflow-key>"
            },
            "urn": "<webhook-urn>",
            "__self__": "..."
        }

At my ngrok endpoint I have a basic Node ExpressJS server running. The server is set to respond to all methods across my designated callback url. I have also verfied my callback url is valid and active through postman, with POST request being successfully received and returning a valid 2XX reponse.

I then post a translation job like below to the Model Derivative API, and the job successfully starts and processes the job. I can verify this by manually calling to check the status of a job through the Model Derivative API, however my webhook callback endpoint never receives any notification of transformation completion event.

{
    "input": {
        "urn": "<Input Urn>"
    },
    "output": {
        "destination": {
            "region": "us"
        },
        "formats": [
            {
                "type": "svf",
                "views": ["3d"]
            }
        ],
        "misc": {
            "wokflow": "<my-workflow-key>"
        }
    }
}

Is there anything obvious that I might be missing as to why the webhook event never seems to be triggered, or any other way that I could see if the webhook event was even attempted to be fired from Autodesks/Forges side?

apollocr
  • 215
  • 1
  • 2
  • 13

1 Answers1

1

There seems to be a typo in the job payload: wokflow should be workflow.

Note that you can also test incoming webhook requests using online tools such as https://webhook.site.

Petr Broz
  • 8,891
  • 2
  • 15
  • 24
  • Good spotting! I've re-deployed everything with corrected the typo, but unfortunately still no success. I've also deployed an additional webhook using webhook.site - but also no event was received here too. – apollocr Nov 05 '20 at 10:05
  • Apart from the typo, the rest you posted here seems ok, and should work fine. I've recently added support for specifying the "workflow ID" when translating objects from within our [Forge extension for Visual Studio Code](https://marketplace.visualstudio.com/items?itemName=petrbroz.vscode-forge-tools). Could you give it a try? Create a new webhook, and start a new translation using the `Translate Object (Custom)` command, providing your workflow ID. – Petr Broz Nov 05 '20 at 11:30
  • I've just tried your VS Code extension, and all works perfectly now! The only obvious difference I could see between the webhook I was provisioning vs the one from VS Code was the "workflowAttributes" parameter - which I had omit from my original webhook - but included in the new webhook. Not sure if that would have been the main issue or if something else was going wrong on my end... – apollocr Nov 05 '20 at 21:23
  • 1
    The `workflowAttributes` are optional so that shouldn't be the issue. Try updating your question with the exact requests you're sending to Forge (just exclude the bearer token) when creating a webhook, and when submitting a job. Perhaps we can find something more in there. – Petr Broz Nov 06 '20 at 07:39