Webhooks

Webhooks notify and help you collect information about the key events that happen in your Crowdin project, like completed translations or proofreading. These user-defined callbacks enable Crowdin to open previously set URLs via HTTP.

Only project owners and project managers can register a webhook.

You can configure webhooks to listen for the following events: project fully translated or reviewed, file fully translated or reviewed, translation added, updated, deleted, approved or unapproved.

Overview

Provide the following information to create a webhook in Crowdin:

  • A name for the webhook (for example, “App Project Translated”).
  • The URL where the callback should be sent.
  • The request method, either GET or POST that indicates the desired action to be performed for a given resource.
  • The content type (multipart/form-data, application/json, application/x-www-form-urlencoded available only for the POST request method).
  • The events to post to the URL. You can select either one event or a specific set of events.

Adding Webhooks

To configure webhooks in Crowdin, follow these steps:

  1. Go to Project Settings, API tab.
  2. Scroll to Webhooks section and click Add Webhook. Webhook hinzufügen
  3. Specify the webhook name and URL to receive requests.
  4. Select a convenient request method GET or POST. If you select POST – choose a content type for this request method.
  5. Select a single event or set of events to receive notifications on.
  6. Click Test to check what payload you will receive.
  7. Click Add to save the changes. Webhook erstellen

Events

You can configure webhooks for the following events:

File fully translated

The webhook will be triggered when any of your project files get fully translated.

Payload example:

{
    "event": "file.translated",
    "project": {{project_identifier}},
    "project_id": {{project_id}},
    "language": {{language_code}},
    "file_id": {{file_identifier}},
    "file": {{file_name}}
}

File fully reviewed

The webhook will be triggered when any of your project files get fully reviewed.

Payload example:

{
    "event": "file.approved",
    "project": {{project_identifier}},
    "project_id": {{project_id}},
    "language": {{language_code}},
    "file_id": {{file_identifier}},
    "file": {{file_name}}
}

Project fully translated

The webhook will be sent when all the strings of the project are translated.

Payload example:

{
    "event": "project.translated",
    "project": {{project_identifier}},
    "project_id": {{project_id}},
    "language": {{language_code}}
}

Project fully reviewed

The webhook will be sent when all the strings of the project are reviewed.

Payload example:

{
    "event": "project.approved",
    "project": {{project_identifier}},
    "project_id": {{project_id}},
    "language": {{language_code}}
}

Exported translation updated

The webhook will be sent when final translation of a string is updated.

Payload example:

{
    "event": "translation.updated",
    "project": {{project_identifier}},
    "project_id": {{project_id}},
    "language": {{language_code}},
    "source_string_id": {{source_string_identifier}},
    "old_translation_id": {{old_translation_identifier}},
    "new_translation_id": {{new_translation_identifier}},
    "user": {{user_name}},
    "user_id" {{user_identifier}},
    "file_id": {{file_identifier}},
    "file": {{file_name}}
}

Suggested translation added

The webhook will be triggered when a string from the project gets translated.

Payload example:

{
    "event": "suggestion.added",
    "project": {{project_identifier}},
    "project_id": {{project_id}},
    "language": {{language_code}},
    "file_id": {{file_identifier}},
    "file": {{file_name}},
    "source_string_id": {{source_string_identifier}},
    "translation_id": {{translation_identifier}},
    "user": {{user_name}},
    "user_id": {{user_identifier}}
}

Suggested translation updated

The webhook will be triggered when previously added translation for a string from the project is updated.

Payload example:

{
    "event": "suggestion.updated",
    "project": {{project_identifier}},
    "project_id": {{project_id}},
    "language": {{language_code}},
    "file_id": {{file_identifier}},
    "file": {{file_name}},
    "source_string_id": {{source_string_identifier}},
    "translation_id": {{translation_identifier}},
    "user": {{user_name}},
    "user_id": {{user_identifier}}
}

Suggested translation deleted

The webhook will be triggered when a previously added translation for the string gets deleted.

Payload example:

{
    "event": "suggestion.deleted",
    "project": {{project_identifier}},
    "project_id": {{project_id}},
    "language": {{language_code}},
    "file_id": {{file_identifier}},
    "file": {{file_name}},
    "source_string_id": {{source_string_identifier}},
    "translation_id": {{translation_identifier}},
    "user": {{user_name}},
    "user_id": {{user_identifier}}
}

Suggested translation approved

The webhook will be triggered when previously added translation for the string gets approved.

Payload example:

{
    "event": "suggestion.approved",
    "project": {{project_identifier}},
    "project_id": {{project_id}},
    "language": {{language_code}},
    "file_id": {{file_identifier}},
    "file": {{file_name}},
    "source_string_id": {{source_string_identifier}},
    "translation_id": {{translation_identifier}},
    "user": {{user_name}},
    "user_id": {{user_identifier}}
}

Suggested translation unapproved

The webhook will be triggered when a previously added translation for the string is unapproved.

Payload example:

{
    "event": "suggestion.disapproved",
    "project": {{project_identifier}},
    "project_id": {{project_id}},
    "language": {{language_code}},
    "file_id": {{file_identifier}},
    "file": {{file_name}},
    "source_string_id": {{source_string_identifier}},
    "translation_id": {{translation_identifier}},
    "user": {{user_name}},
    "user_id": {{user_identifier}}
}

Edit or Delete Webhooks

The list of existing webhooks will be shown in the Webhooks section. You can edit or delete webhooks right from the list displayed.

Webhooks bearbeiten/löschen

Zugriffsverlauf

Calls history of all the webhooks added will be accessible in the same section. Use the filter to check all or only unsuccessful webhook notifications.

Zugriffsverlauf

War dieser Artikel hilfreich?