Transifex

  • Documentation
  • API
  • Webhooks

Webhooks

The Webhooks endpoint handles READ/UPDATE operations for webhooks in a project.

You must authenticate with a token when calling this endpoint.

Getting a list of webhooks for a project

URL: api.transifex.com/organizations/<org_slug>/projects/<project_slug>/webhooks/

GET

This request is used to get list of webhooks for a given project.

Example:

curl -i --user api:<token> -X GET api.transifex.com/organizations/transifex/projects/website-project/webhooks/
HTTP/1.0 200 OK
...
[   
    {
        "id":12345,
        "secret_key":"my secret",
        "url":"https://hooks.zapier.com/hooks/catch/2543117/2prft5/",
        "event_type":"translation_completed",
        "status":"active"
    }, …
]

Creating a new webhook

URL: api.transifex.com/organizations/<org_slug>/projects/<project_slug>/webhooks/

POST

This request is used to create a new webhook for a project.

The allowed parameters are:

  • secret_key (optional) - the secret key of the webhook, can be numbers of characters
  • url - the URL the webhook should call
  • event_type - the event type of the webhook: all_events, translation_completed, review_completed, or fillup_completed
  • status - whether the webhook should be set to active or inactive

Example:

curl -i --user api:<token> -X POST api.transifex.com/organizations/transifex/projects/website-project/webhooks/ -d '{"url":"https://hooks.zapier.com/hooks/catch/2543117/2prft5/","status":"active","event_type":"translation_completed", "secret_key": "my secret"}' -H "Content-Type: application/json"
HTTP/1.0 200 OK
...

{
    "id": 12346 
    "secret_key":"my secret",
    "url":"https://hooks.zapier.com/hooks/catch/2543117/2prft5/",
    "event_type":"translation_completed",
    "status":"active"
}

Getting details for a webhook

URL: api.transifex.com/organizations/<org_slug>/projects/<project_slug>/webhooks/<webhook_id>/

GET

This request is used to get details of a specific webhook for a project.

Example:

curl -i --user api:<token> -X GET api.transifex.com/organizations/transifex/projects/website-project/webhooks/12345/ 
HTTP/1.0 200 OK
...
{
    "id":12345,
    "secret_key":"my secret",
    "url":"https://hooks.zapier.com/hooks/catch/2543117/2prft5/",
    "event_type":"translation_completed",
    "status":"active"
}

Updating a webhook

URL: api.transifex.com/organizations/<org_slug>/projects/<project_slug>/webhooks/<webhook_id>

PATCH

This request is used to edit details of a specific webhook for a project (URL, secret, event type, or status).

Example:

curl -i --user api:<token> -X PATCH api.transifex.com/organizations/transifex/projects/website-project/webhooks/12345/ -d '{"event_type":"review_completed"}' -H "Content-Type: application/json"
HTTP/1.0 200 OK
...
{
    "id":12345,
    "secret_key":"my secret",
    "url":"https://hooks.zapier.com/hooks/catch/2543117/2prft5/",
    "event_type":"review_completed",
    "status":"active"
}

Deleting a webhook

URL: api.transifex.com/organizations/<org_slug>/projects/<project_slug>/webhooks/<webhook_id>

DELETE

This request is used to delete a webhook from a project.

Example:

curl -i --user api:<token> -X DELETE https://api.transifex.com/organizations/transifex/projects/website-project/webhooks/12345/
HTTP/1.1 204 No Content

CONTINUE READING