Documentation

API

Translation API: REST endpoints reference

The WebTranslateIt REST API: schema, authentication, rate limiting, CORS and every endpoint for projects, files, segments and translations. 3 min read

This document describes the resources that make up the WebTranslateIt API. If you have any problems or requests, please contact support.

This API is considered stable. No breaking changes will occur.

Schema

All API access is over HTTPS and accessed from:

https://webtranslateit.com/api/

Data may be returned by WebTranslateIt as JSON, YAML and XML, depending on the endpoints.

Authentication

Authentication is made by so-called API tokens. Each project gets 2 unique API tokens you can find in the project settings:

  • the read-write token. A token that allows calls to all API endpoints,
  • the read-only token. A token that allows calls to GET API endpoints (Project API, File API and Statistics API).

The token goes in the URL path — there is no Authorization header to set. Organization-level endpoints take an Organization API token, which you will find in your organization settings.

Throughout these docs, PROJECT_TOKEN and ORGANIZATION_TOKEN mark the place to paste your own token. Every example is otherwise ready to run:

GET/api/projects/:project_token.json
curl "https://webtranslateit.com/api/projects/PROJECT_TOKEN.json"
json
{
  "project": {
    "name": "Doughnut",
    "id": 406,
    "source_locale": { "name": "English", "code": "en" },
    "target_locales": [{ "name": "French", "code": "fr" }],
    "project_files": []
  }
}

Treat a read-write token like a password: it can delete files and segments, so keep it out of client-side code and out of version control.

Rate Limiting

We rate limit the API endpoints based on IPs to 25 req/sec. Subsequent requests are ignored and get a 429 response.

CORS

All API endpoints are accessible via Cross-origin resource sharing (CORS), which means that all endpoints can be requested from another domain from which the first resource was served.

HTTP Verbs

The WebTranslateIt API uses appropriate HTTP verbs for each action.

  • GET Used for retrieving resources.
  • POST Used for creating resources.
  • PATCH Used for replacing resources (although PUT can also be used).
  • DELETE Used for deleting resources.

Endpoints

11 different resources can be accessed. Their specification is separated into different sections in the documentation:

We made a ruby client that uses these endpoints. Use it or take a look at it as an implementation example.