April 24, 2018

Introducing Webhook for Model Derivative API

Default blog image

Webhook now supports the Model Derivative event extraction.finished, so your app can be notified when translation job finishes. 

To use it, (1) create a hook specifying a scope.workflow:

{
  "callbackUrl": "http://bf067e05.ngrok.io/callback",
  "scope": {
    "workflow": "my-workflow-id"
  }
}

And (2) when posting a translation job, specify the misc.workflow:

{
  "input": {
    "urn": "dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6d2htZHRlc3RzdGcvQ2FzZUlubmVyLmlwdA"
  },
    "output": {
    "formats": [{
      "type": "obj"
    }]
  },
  "misc": {
    "workflow": "my-workflow-id"
  }
}

That's all! The callback endpoint with be called with, among other info, the URN of the model. 

Check the documentation step-by-step tutorial and what you need to use it.

Related Posts