Developer tools

HTTP API

Everything the CLI does is an HTTP call with a bearer token, so a script, a build system or an agent can drive a project without the CLI.

What you get

Every operation, one bearer token away.

  • Scriptable from the CLI

    Push, pull and sync from a terminal, a build phase or a coding agent's shell, with a token in the environment.

    The CLI
  • Updates over the air

    Publish the verified strings and let the running app fetch them, so a fixed translation reaches users without a store release.

    Over-the-air delivery
  • Pull a subset by tag

    Tag keys by feature or platform and pull only those, so one project can serve several apps without shipping each other's strings.

  • Runs in CI

    Push the source language on merge and pull every language before the release build, on any CI that can run a shell.

    CI pipelines

Set it up

From nothing to every language.

  1. Step 1: Authenticate with a project token

    The same token the CLI stores. Scopes: read for pulling, push for writing values and files, manage for creating and deleting keys.

    shell
    curl -fsS "https://anylocale.com/api/loc/locales?project=my-app" \
        -H "Authorization: Bearer $ANYLOCALE_TOKEN"
  2. Step 2: Pull a file

    One locale in one format. Optional: tag, platform, file for a string table, and comments=0 to leave descriptions out.

    shell
    curl -fsS "https://anylocale.com/api/loc/pull?project=my-app&locale=de&format=json" \
        -H "Authorization: Bearer $ANYLOCALE_TOKEN"
  3. Step 3: Create a key and write its text

    A plural locale takes an object of categories instead of a string.

    shell
    curl -fsS -X POST "https://anylocale.com/api/loc/keys?project=my-app" \
        -H "Authorization: Bearer $ANYLOCALE_TOKEN" -H "Content-Type: application/json" \
        -d '{"name":"home.title","description":"Header on the home screen"}'
    curl -fsS -X PUT "https://anylocale.com/api/loc/keys/home.title/translations?project=my-app" \
        -H "Authorization: Bearer $ANYLOCALE_TOKEN" -H "Content-Type: application/json" \
        -d '{"values":{"en":"Home","de":"Startseite"}}'
  4. Step 4: List, change and delete keys

    The listing takes the same tag and platform filters as a pull. Changing and deleting need the manage scope.

    shell
    curl -fsS "https://anylocale.com/api/loc/keys?project=my-app&platform=ios" \
        -H "Authorization: Bearer $ANYLOCALE_TOKEN"
    curl -fsS -X PATCH "https://anylocale.com/api/loc/keys/home.title?project=my-app" \
        -H "Authorization: Bearer $ANYLOCALE_TOKEN" -H "Content-Type: application/json" \
        -d '{"description":"Header on the home screen, max 24 characters"}'
    curl -fsS -X DELETE "https://anylocale.com/api/loc/keys/home.title?project=my-app" \
        -H "Authorization: Bearer $ANYLOCALE_TOKEN"

Good to know

  • Errors come back as JSON with a single error field and the matching status: 400 for a refused input, 401 and 403 for the token, 404 for a project or key that is not yours, 413 over the upload cap, 410 for an archived distribution.
  • An unknown query parameter is a 400 that names the parameters the endpoint takes, so a typo never silently widens a pull.
  • Uploads are capped at 24 MB, enough for a whole-catalog string catalog.

Questions

What are the scopes?
read for pulling files and bundles, push for writing values and files, manage for creating and deleting keys. A token carries the scopes it was issued with, so a pulling job cannot delete a key.
How are errors returned?
As JSON with a single error field and the matching status: 400 for a refused input or an unknown query parameter, 401 and 403 for the token, 404 for a project or key that is not yours, 413 for a push over 24 MB, 410 for an archived distribution.
How big can an upload be?
24 MB per push, enough for a string catalog that carries every locale of a large app in one document. Over that the answer is a 413.
Can a coding agent do this?
Yes. Every step on this page is a shell command with a token in the environment, which is exactly what an agent runs. Give it a token with the scopes the task needs and nothing more.

Start with the file your app already ships.

After checkout, import one strings file and read the first drafts within minutes.

Nothing to connect and nothing to install. The CLI is optional.