WebHooks

WebHooks are a way to tell WebTranslateIt to call a script on one of your own web servers whenever a translation was made and react in any way you want. They can be thought of as push notifications.


Setup a WebHook

A WebHook can be setup in your project settings. Provide the WebHook section with the URL of your webservice and WebTranslateIt will request a HTTP POST request everytime a translation was made on your project.

The HTTP POST request made contains a payload, that is to say parameters indicating what was updated. For instance:

{ "payload" =>
  {
    "project_id" => 123,
    "string_id" => 1234,
    "locale" => "fr",
    "file_id" => 12345,
    "api_url" => "https://webtranslateit.com/api/projects/:api_token/files/12345/locales/fr"
  }
}

WebHook requests are made in the background, after the linguistic file is updated on WebTranslateIt’s server, so there can be a small delay between the moment a translation is saved and the time the WebHook request is made. Timeout is set to drop requests exceeding 10 seconds.


What can you do with a WebHook?

You could use a WebHook to:

  • download the latest version of your linguistic file on your webserver, so translators can live-reload your website.
  • create a new build of your software and make it available to download.
  • automatically commit the new version of the file to your Version Control System.
  • send an e-mail notification or write a line on Campfire or IRC.

More information about WebHooks