Knowledge Base

Documentation on how to translate software with POEditor

Callbacks are a tool developed for you to get notified of specific events in POEditor localization projects, that can be set up by the project owner and admins.

These notifications help you save resources by avoiding polling the API at certain intervals.

When the events are triggered, POEditor fires a request to a specific web address you set for that event.

To set up a callback, go to Account Settings > Integrations > Callbacks. Then select a project and your desired event and add the URL you want fired when the event is triggered.

You can also add a secret to the calls if you want to protect the endpoint. The call will have a “X-Callback-Secret” header set with that value.

Callbacks setup (Integrations page) - POEditor localization platform

The events supported for callbacks at this time are:

  • Language completed
  • Language proofread (requires Proofreading to be enabled in Project Settings)
  • New terms added (manually, file import, API, integrations)

After you set your callback, you can send a test to your endpoint:

{
    "event": {
        "name": "test"
    }
}

Below are JSON payload examples we send for each event:

{
    "event": {
        "name": "language.completed"
    },
    "project": {
        "id": ******,
        "name": "Load data #2",
        "public": 0,
        "open": 0,
        "created": "2019-05-17T10:31:50+0000"
    },
    "language": {
        "name": "German",
        "code": "de"
    },
    "stats": {
        "strings": {
            "translated": 3,
            "fuzzy": 0,
            "proofread": 0
        }
    }
}
{
    "event": {
        "name": "language.proofread"
    },
    "project": {
        "id": ******,
        "name": "Android localization",
        "public": 1,
        "open": 0,
        "created": "2015-08-13T09:39:32+0000"
    },
    "language": {
        "name": "English",
        "code": "en"
    }
}
{
    "event": {
        "name": "new_terms.added"
    },
    "project": {
        "id": ******,
        "name": "Android localization",
        "public": 1,
        "open": 0,
        "created": "2015-08-13T09:39:32+0000"
    }
}

The data is sent via POST and the JSON is put in a payload parameter.

Note that we listen for a response with HTTP status code 200 when we send the callback only for a little while (30 seconds at this point). After that a timeout error is generated.

Please make sure you don’t do all your processing on that endpoint and create a separate process for it. If we don’t get a 200 HTTP code when we fire the callback we try again 2 more times. After that we give up.

You can check your callbacks activity in the last 10 days in your callbacks log.