Web Kancaları

Web kancaları, tamamlanan çeviriler veya düzeltme okuması gibi Crowdin Enterprise projenizde gerçekleşen önemli olaylar hakkında bilgi toplamanıza yardımcı olur ve bildirir. After you configure a webhook for the project, Crowdin Enterprise will start sending POST or GET requests with data to the webhook URL via HTTP.

Only admins and group/project managers can register a webhook.

Kullanım Durumları

You can add webhooks to build integrations with the services or with your backend. Örneğin:

  • 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).
  • Create custom integrations with Crowdin Enterprise.

Olaylar

You can configure webhooks for the following types of events:

  • File fully translated – a file is translated into one of the target languages

  • File fully reviewed – translations in a file are approved for one of the target languages

  • File added

  • File updated

  • File reverted

  • File deleted

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

  • Project fully reviewed – translations in all files are approved for one of the target languages

  • 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

  • Dosya tamamen çevrildi
{
  "events": [
    {
      "event": "file.translated",
      "project": "impact",
      "project_id": "778899",
      "language": "uk",
      "file_id": "1",
      "file": "example.txt"
    }
  ] }
  • Dosya tamamen gözden geçirildi
{
  "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"
        }
    ] }
  • Proje tamamen çevrildi
{
    "events": [
        {
            "event": "project.translated",
            "project": "impact",
            "project_id": "778899",
            "language": "uk"
        }
    ] }
  • Proje tamamen gözden geçirildi
{
    "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" } ] }

Web Kancaları Ekleme

To configure webhooks in Crowdin Enterprise, open your project and go to Integrations > Webhooks on the left panel. Click Create to start configuring your new webhook.

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

  • The webhook name (for example, “New translation added”).
  • URL’ye gönderilecek olaylar. Ya bir olayı ya da belirli bir olaylar dizisini seçebilirsiniz.
  • Geri çağrının gönderilmesi gereken URL.
  • The request method that indicates the desired action to be performed for a given resource (use either GET or POST).
  • POST istek yöntemi için içerik türü (multipart/form-data, application/json, veya application/x-www-form-urlencoded).
  • For the application/json content type, you can select Batch webhooks to merge multiple events into a single request.

Optionally, you can add special headers to your webhook. Yetkilendirme yöntemi ve daha fazlası olarak ek güvenlik için kullanılabilirler. For example, if you add headers, your webhook endpoint can check them to ensure that information is coming from Crowdin Enterprise.

Add Webhook

When adding a webhook, you can test how your application will react to that call.

Test Webhook

Depending on your approach to webhooks management, you might need to add dedicated Crowdin Enterprise IP addresses to your firewall to allow Crowdin Enterprise to open the pre-configured webhook URLs.

Read more about IP Addresses.

Özel Yükler

Each event type in Crowdin Enterprise has a specific payload format with the relevant event information. You can customize the webhook payload to add and organize the elements the way your system requires.

To check the event’s possible variables, hover over the Info icon in the Payload section’s right upper corner.

Özel Yük

Sending Webhooks to Slack

With the help of Crowdin Enterprise webhooks, you can send notifications about pre-configured event types directly to a specific Slack channel.

To configure the webhooks’ sending to Slack, you’d need to create a simple Slack app. Read more about Sending messages to Slack using Incoming Webhooks.

As soon as you create and configure your Slack app, you’ll have a Webhook URL that should be used for the Webhooks configuration in your Crowdin Enterprise project.

Note: To send webhooks to Slack, ensure that your custom payload contains the "text" field, and the Batch webhooks option is cleared.

Web Kancalarını Düzenleyin veya Silin

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

Activities

After the events are triggered, you will be able to review the activity of each webhook separately. Use the filter to review all or only unsuccessful webhook notifications.

Webhooks Activities

Alternatively, you can review the full list of sent webhooks in the Webhooks Log. Filter webhook notifications by result (Any or Unsuccessful), event types, or name.

Webhooks Log

Yardım Arama

Need help working with Webhooks or have any questions? Destek Ekibine Ulaşın.

Bu makale yararlı oldu mu?