Webhooks

I webhook ti notificano ed aiutano a raccogliere informazioni sugli eventi chiave che avvengono nel tuo progetto di Crowdin, come le traduzioni completate o la correzione delle bozze. Dopo aver configurato un webhook per il progetto, Crowdin inizierà a inviare richieste POST o GET con i dati all’URL del webhook tramite HTTP.

Solo i proprietari e i gestori del progetto possono registrare un webhook.

Casi d’Uso

You can add webhooks to build integrations with the services or with your backend. Per esempio:

  • Set up a webhook to send notifications to the system you use.
  • Pass information to the third-party services with the specific request requirements (for example, HTTP method, сontent type).
  • Crea integrazioni personalizzate con Crowdin.

Eventi

You can configure webhooks for the following types of events:

  • File completamente tradotto

  • File completamente revisionato

  • File added

  • File updated

  • File reverted

  • File deleted

  • Project fully translated – all files are translated into one of the target languages

  • Progetto completamente revisionato: le traduzioni in tutti i file per una delle lingue di destinazione sono approvate

  • Exported translation updated – final translation of a string is updated

  • Source string added

  • Source string updated

  • Source string deleted

  • Suggested translation added – a string in the project is translated

  • Suggested translation updated – a translation for a string in the project is updated

  • Suggested translation deleted – one of the translations is deleted

  • Suggested translation approved – a translation for a string is approved

  • Suggested translation disapproved – approval for a previously added translation is removed

  • Task added

  • Task status changed

  • Task deleted

Webhook Payload Examples

  • File completamente tradotto
{
  "events": [
    {
      "event": "file.translated",
      "project": "impact",
      "project_id": "778899",
      "language": "uk",
      "file_id": "1",
      "file": "example.txt"
    }
  ] }
  • File completamente revisionato
{
  "events": [
    {
      "event": "file.approved",
      "project": "impact",
      "project_id": "778899",
      "language": "uk",
      "file_id": "1",
      "file": "example.txt"
    }
  ] }
  • File added
{
  "events": [
    {
      "event": "file.added",
      "project": "impact",
      "project_id": "778899",
      "file_id": "1",
      "file": "example.txt",
      "user_id": "1",
      "user": "john_doe",
      "revision": "1"
    }
  ] }
  • File updated
{
  "events": [
    {
      "event": "file.updated",
      "project": "impact",
      "project_id": "778899",
      "file_id": "1",
      "file": "example.txt",
      "user_id": "1",
      "user": "john_doe",
      "revision": "1"
    }
  ] }
  • File reverted
{
    "events": [
        {
            "event": "file.reverted",
            "project": "impact",
            "project_id": "778899",
            "file_id": "1",
            "file": "example.txt",
            "user_id": "1",
            "user": "john_doe",
            "revision": "1"
        }
    ] }
  • File deleted
{
    "events": [
        {
            "event": "file.deleted",
            "project": "impact",
            "project_id": "778899",
            "file_id": "1",
            "file": "example.txt",
            "user_id": "1",
            "user": "john_doe"
        }
    ] }
  • Progetto completamente tradotto
{
    "events": [
        {
            "event": "project.translated",
            "project": "impact",
            "project_id": "778899",
            "language": "uk"
        }
    ] }
  • Progetto revisionato completamente
{
    "events": [
        {
            "event": "project.approved",
            "project": "impact",
            "project_id": "778899",
            "language": "uk"
        }
    ] }
  • Exported translation updated
{
    "events": [
        {
            "event": "translation.updated",
            "project": "impact",
            "project_id": "778899",
            "language": "uk",
            "source_string_id": "1",
            "old_translation_id": "1",
            "new_translation_id": "1",
            "user": "john_doe",
            "user_id": "1",
            "file_id": "1",
            "file": "example.txt"
        }
    ] }
  • Source string added
{
    "events": [
        {
            "event": "string.added",
            "project": "impact",
            "project_id": "778899",
            "string_id": "1",
            "user": "john_doe",
            "user_id": "1",
            "file_id": "1",
            "file": "example.txt"
        }
    ] }
  • Source string updated
{
    "events": [
        {
            "event": "string.updated",
            "project": "impact",
            "project_id": "778899",
            "string_id": "1",
            "user": "john_doe",
            "user_id": "1",
            "file_id": "1",
            "file": "example.txt"
        }
    ] }
  • Source string deleted
{
    "events": [
        {
            "event": "string.deleted",
            "project": "impact",
            "project_id": "778899",
            "string_id": "1",
            "user": "john_doe",
            "user_id": "1",
            "file_id": "1",
            "file": "example.txt"
        }
    ] }
  • Suggested translation added
{
    "events": [
        {
            "event": "suggestion.added",
            "project": "impact",
            "project_id": "778899",
            "language": "uk",
            "source_string_id": "1",
            "translation_id": "1",
            "user": "john_doe",
            "user_id": "1",
            "file_id": "1",
            "file": "example.txt"
        }
    ] }
  • Suggested translation updated
{
    "events": [
        {
            "event": "suggestion.updated",
            "project": "impact",
            "project_id": "778899",
            "language": "uk",
            "source_string_id": "1",
            "translation_id": "1",
            "user": "john_doe",
            "user_id": "1",
            "file_id": "1",
            "file": "example.txt"
        }
    ] }
  • Suggested translation deleted
{
    "events": [
        {
            "event": "suggestion.deleted",
            "project": "impact",
            "project_id": "778899",
            "language": "uk",
            "source_string_id": "1",
            "translation_id": "1",
            "user": "john_doe",
            "user_id": "1",
            "file_id": "1",
            "file": "example.txt"
        }
    ] }
  • Suggested translation approved
{
    "events": [
        {
            "event": "suggestion.approved",
            "project": "impact",
            "project_id": "778899",
            "language": "uk",
            "source_string_id": "1",
            "translation_id": "1",
            "user": "john_doe",
            "user_id": "1",
            "file_id": "1",
            "file": "example.txt"
        }
    ] }
  • Suggested translation disapproved
{
    "events": [
        {
            "event": "suggestion.disapproved",
            "project": "impact",
            "project_id": "778899",
            "language": "uk",
            "source_string_id": "1",
            "translation_id": "1",
            "user": "john_doe",
            "user_id": "1",
            "file_id": "1",
            "file": "example.txt"
        }
    ] }
  • Task added
{ "events": [
        { "event": "task.added", "project": "impact", "project_id": "778899", "language": "uk", "task_id": "", "user": "john_doe", "user_id": "1" } ] }
  • Task status changed
{ "events": [
        { "event": "task.statusChanged", "project": "impact", "project_id": "778899", "language": "uk", "task_id": "", "old_status": "", "new_status": "", "user": "john_doe", "user_id": "1" } ] }
  • Task deleted
{ "events": [
        { "event": "task.deleted", "project": "impact", "project_id": "778899", "language": "uk", "task_id": "", "user": "john_doe", "user_id": "1" } ] }

Aggiungere Webhook

Per configurare i webhook su Crowdin, apri il tuo progetto e vai a Integrazioni > Webhook. Clicca Aggiungi Webhook per avviare la configurazione del tuo nuovo webhook.

You will need to provide the following information to register a webhook:

  • Il nome del webhook (ad esempio, “Progetto App Tradotto”).
  • L’URL in cui la richiamata dovrebbe essere inviata.
  • The request method that indicates the desired action to be performed for a given resource (use either GET or POST).
  • Il tipo di contenuto per il metodo di richiesta POST (multipart/form-data, application/json, o application/x-www-form-urlencoded).
  • For the application/json content type, you can select Batch webhooks to merge multiple events into a single request.
  • Gli eventi da postare all’URL. Puoi selezionare un evento o un set di eventi specifico.

Aggiungendo un webhook, clicca Testa per vedere come reagirà la tua applicazione a quella chiamata.

Add Webhook

In base al tuo approccio alla gestione dei webhook, potresti dover aggiungere gli indirizzi IP di Crowdin dedicati al tuo firewall per consentire a Crowdin di aprire gli URL del webhook preconfigurato.

Leggi di più sugli Indirizzi IP.

Modifica o Elimina Webhook

You can access the list of all existing webhooks within a specific project. You will be able to edit or delete webhooks right from the list of webhooks displayed.

Manage Webhooks

Cronologia delle Chiamate

Nella sezione Storico Chiamate, puoi vedere l’elenco delle chiamate di tutti i webhook aggiunti al progetto. Usa il filtro per visualizzare tutte o solo le notifiche del webhook fallite.

storico delle chiamate

Cercare Assistenza

Need help working with Webhooks or have any questions? Contatta il Team di Supporto.

Questo articolo è stato utile?