• Documentation
  • API
  • Projects

Projects

The projects endpoint handles CRUD operations on projects. It is accessed under the following two URLs.

Project creation methods

URL: /projects/

POST

Create a new project. The user must submit the necessary values for the nameslugdescription and source_language_code of the project as a JSON string. If the project is open source he must also submit a valid url (e.g. http://www.transifex.com) for the field repository_url. If the project is private he must submit the field private instead, that can be set to true or false. Additionally, the user may submit values for the following fields:

  • long_description
  • private
  • homepage
  • trans_instructions
  • tags - list of tags
  • maintainers
  • team
  • auto_join
  • license
  • fill_up_resources
  • repository_url
  • organization
  • archived

The only available characters for the slug field are alphanumeric ones, the underscore and the dash.

The maintainers field is a list of comma-separated usernames. If it is not set, then the owner of the project will be also set as the maintainer of the project.

The source_language_code field specifies the source language that will be used for all resources of the project. A list of the supported languages and their respective codes can be found at Languages.

The available options for the license field are "proprietary", "permissive_open_source" and "other_open_source." If a license is not specified, one is chosen automatically based on whether the project is set to private or not.

If a project is denoted either as permissive_open_source or other_open_source, the field repository_url is mandatory and should contain a link to the public repository of the project to be created.

If the system should fill up resources automatically with 100% similar matches from the Translation Memory, the fill_up_resources option should be set to true.

The organization should be set to the slug of the organization that the new project will belong to. If the user is an Administrator in only one organization, then this is optional.

The team field can be set if you want to reuse an existing team of the organization. If no team is passed, a new one will be created for the project automatically.

By setting the archived boolean flag, organization administrators can archive an inactive project or restore an archived one.

Example:

The following POST call will attempt to create a project with the slug 'transifex' and fail, since there is an existing project with that slug:

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

HTTP/1.0 400 BAD REQUEST
...
{'slug': [u'Project with this Slug already exists.']}

Project instance methods

URL: /project/<project_slug>

GET

Return the fields slugnamedescription and source_language_code for the project of the specified slug in JSON format. If the keyword details is used as a GET parameter, a more complete list of fields is returned. This includes the above fields as well as the following ones:

  • long_description
  • homepage
  • created
  • trans_instructions
  • tags
  • team - Integer that points to the Team id being used by the project.
  • auto_join
  • maintainers
  • fill_up_resources
  • resources - list of the resources of the project containing the fields slug and name.
  • teams - list of language codes for the Teams created for the project.

Example:

$ curl -i -L --user username:password -X GET  \
http://www.transifex.com/api/2/project/transifex/?details

HTTP/1.1 200 OK
...
{
    "name": "Transifex",
    "slug": "transifex",
    "description": "Social Localization Platform",
    "created": "2009-04-21 08:12:16",
    "tags": "translations,l10n,i18n",
    "team": {
        "id": 12345,
        "name": "Transifex team"
    },
    "organization": {
        "slug": "transifex"
    },
    "teams": [
        "eu",
        "lv",
        ...
    ],
    "resources": [
        {
            "slug": "txc",
            "name": "Transifex core"
        },
        ...
    ],
}

PUT

Update the details for the specified project. Parameters should be given as a JSON-encoded string, like in the POST request above. The available fields are the same as those in the POST request above. However, the field source_language_code is not allowed, if the project has resources, since that would create issues with existing content already in the Transifex. Also, from the API it is not possible to modify the slug of the project.

Example:

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

HTTP/1.0 400 BAD REQUEST
...
Field 'slug' is not allowed.

---

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

HTTP/1.0 200 OK
...
OK

DELETE

Delete a project with a specific slug.

Example:

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

HTTP/1.1 204 NO CONTENT
...