guides
Projects from files (CI API)
Send files from a repository or a build pipeline in one call, and let wxrks find or create the project and its work units.
A continuous project is identified by its org unit and a CI tag you choose, for example my-app-strings. Every call with the same org unit and tag reaches the same project, so a pipeline can push files on every release without keeping project ids.
Upload a file
Call Upload Continuous Project File with the org unit UUID and the CI tag in the path, and the file as multipart/form-data:
curl -X POST 'https://app.wxrks.com/api/v3/project/ci/<org unit uuid>/my-app-strings' \
-H "X-AUTH-TOKEN: $WXRKS_TOKEN" \
-F 'file=@./locales/en.json' \
-F 'path=locales' \
-F 'locales=de-DE' \
-F 'locales=fr-FR'
| Field | What it does |
|---|---|
file | The file, required. A ZIP adds every file inside it. |
locales | Target languages. By default, the org unit's target languages. |
source | Source language. By default, the org unit's default source language. It must match the project's source language. |
path | Folder of the file. A file is identified by its name and path, so two files with the same name in different folders stay apart. |
workflows | Workflows for the new work units. By default, the workflows the org unit recommends for the file. |
reference, tags | The project reference when the project is created; tags are added to the project. |
What happens:
- wxrks looks for the project with this CI tag in the org unit (a continuous project first, then a draft) and creates it when there is none.
- A new file is added with one work unit per target language.
- The same file with the same content changes nothing, and the call answers
202. If you send new target languages for it, their work units are added and the call answers200. - A changed file in a continuous project is reconciled in place: unchanged segments keep their translations, changed ones become new work, removed ones disappear. In a draft project, the old file and its work units are replaced.
- Uploads of the same file to the same project run one at a time: a second upload of a file that is still being processed is rejected. Send it again once the first one is done.
The answer is the project, with its files.
Create or find the project
You can also create the project before the first upload, to set its details:
- Create Continuous Project returns the project for
orgUnitUUIDandciTag, creating it when needed. It requiresorgUnitUUID,contactUUID,ciTagandreference, and acceptssource,tags,instructionsandcontentMode(FILES, orKEY_VALUEfor keyed strings). - Get Continuous Project finds the project by org unit and CI tag.
Get the translations
- Request Project Translated Files builds the translated files of a workflow step (
workflowLevel) or of chosen work units (workUnitUuids) as a job. Follow it with Check Translation Kit Job Status until it isCOMPLETED, then downloaddownloadFileUrl. - Download Continuous Project Translations returns a ZIP of the project's translated files in the same call. It is deprecated: prefer the job above.
- To follow progress without polling, subscribe to the
WORK_UNIT_TRANSLATION_FILE_READYevent: see Webhooks.