Support Center

Overview

Last Updated: May 31, 2013 04:32PM EEST

Transifex offers an extensive API (Application Programmable Interface).

We try to expose as much of the functionality of Transifex as possible to the API, so that it is easier for you to automate your workflow and integrate Transifex in your existing tools. The API is used in the Transifex Client, too.

The API calls are REST compliant and make use of the most common HTTP methods such as GET, POST, PUT and DELETE.

The main entities in the API are projectsresources, languagestranslation files and translation strings. Each project has a source language and a set of files (resources). In the case of a software project, the source language is the language used in the source code for the translatable strings.

Each resource in turn consists of the source file, that is, the internationalization file with the translatable strings in the source language, and the translations of the strings.

Using the API

You can use a variety of (desktop or web-based) tools to test the API. A quick way to do it is through the command-line tool cURL.

Here is a list with the most useful options for cURL:

  • --user 'user:password': Give your username and your password.
  • -L: Follow HTTP redirections.
  • -i: Show response headers.
  • -X <METHOD>: Specify a HTTP method to use (GET, POST, PUT, DELETE).
  • -d: Pass in parameters enclosed in quotes; multiple parameters are separated by ‘&’.
  • -H: Add any extra headers.

Examples:

GET:

curl -i -L --user username:password -X GET \
https://www.transifex.com/api/2/projects/

POST:

curl -i -L --user username:password -X POST \
-d '{"slug":"foo","name":"Foo","source_language_code":"en","description":"Description"}' \
-H "Content-Type: application/json" https://www.transifex.com/api/2/projects/

curl -i -L --user username:password -X POST -H "Content-Type: application/json" \
-d '{"slug": "bar", "name": "Bar", "i18n_type": "XHTML", "content": "<p>Bar</p>"}' \
https://www.transifex.com/api/2/project/foo/resources/

PUT:

curl -i -L --user username:password -X PUT -d '{"name":"Foo2"}' \
-H "Content-Type: application/json" https://www.transifex.com/api/2/project/foo/

DELETE:

curl -i -L --user username:password -X DELETE \
https://www.transifex.com/api/2/project/foo/

NoteThe trailing slash in the URLs is necessary to avoid any redirects, especially for POST requests.

Authentication

Transifex allows only authenticated requests to the API. Currently, the authentication method supported is the HTTP Basic Authentication. The credentials to access the API are the same as those used to access Transifex itself (username and password). All external applications should make use of the HTTP Basic Authentication, if they need to perform some operations with the Transifex API.

Terminology

  • slug: A small string that will be used in the URL of a project or resource. The allowed characters are the alphanumeric characters as well as the characters '_' and '-'.

  • source language​: The language that the content is originally written into. For instance, in a software program, this is the language used for the strings in the source code.

  • ​i18n type: The format used in a resource for internationalization (i18n). For example, PO, TS, PROPERTIES etc. Check the list of supported formats.​

​​Base URL for API Calls

All API calls should use the following URL prefix:
https://www.transifex.com/api/2/
  • Couldn't find what you were looking for?
  • If you are a client or consider becoming one, email us and get next business-day response.
  • If you are on the free plan, post a public question and receive answers from our community.
support-team@transifex.com
http://assets01.desk.com/
false
transifex
Loading
seconds ago
a minute ago
minutes ago
an hour ago
hours ago
a day ago
days ago
about
false
Invalid characters found
/customer/en/portal/articles/autocomplete