API V1
Projects
Projects
Section titled “Projects”Endpoints for the operations that can be performed on projects of a workspace
API V1 addresses a project by two slugs, {workspaceUrl} and {projectUrl}. List all projects returns them in the self link of each project; see Workspace and project URLs. With an API key, the list contains the projects of the key’s workspace that the key can access.
Permissions
| Operation | Permission |
|---|---|
| List all projects | Any valid API key |
| Get translation status of all accessible workspace projects | generalView on the workspace |
| Get project details | generalView on the project |
| Get project resource file status | resourcesView on the project |
| Create a project | settingsManage on the workspace |
Translation status
Get translation status of all accessible workspace projects returns one entry per project:
statusmaps each language code to the number of texts per status. The statuses areNOT_TRANSLATED,PRE_TRANSLATED,DRAFTandAPPROVED;PRE_TRANSLATEDcounts the texts that are AI translated.urlis the address of the project in the LingoHub app, not its slug.
Get project resource file status reports the same per file and language, with the statuses NOT_TRANSLATED, DRAFT, TRANSLATED and APPROVED. It accepts the query parameter branch; without it, LingoHub reads the default branch.
Project details
linkscontainsself,weburl(the project in the LingoHub app) andresources(the list of its resource files). Two more entries,translationsandsearch, remain for older clients; theirhrefis the worddiscontinued.owner_emailis the billing email address of the workspace.
Resource file status
filePathWithLocalePlaceholderis the path of a file with%{locale}in place of the language. Use it forfilePathswhen you request an export.supportedExportFormatslists the formats the files can be downloaded in:ios.strings,ios.stringsdict,android.string.resources,propertiesandstandard_json. Pass one asprojectTypeto Download a resource file. The export request uses other values forexportFormat.repositoryConnectionshas one entry per provider:github,bitbucket,gitlab,azureandaws_code_commit.connectedistruefor the provider the project is connected to.
Create a project
resourceType decides the file format of the project and can’t be changed later. Allowed values:
| File format | resourceType |
|---|---|
| Android XML | android_xml |
Apple .strings and .stringsdict |
ios_strings |
| Flutter ARB | arb |
| Java properties | properties |
| Gettext PO | gettext_po |
| RESX and RESW | windows_resx |
| Qt Linguist TS | qt_linguist_ts |
| PHP define | php_define |
| INI | standard_ini |
| Ruby on Rails YAML | rails_yaml |
| Symfony YAML | symfony2_yaml |
| JSON | standard_json |
| angular-translate JSON | angular_translate_json |
| React Intl JSON | react_intl_json |
| i18next JSON | i18next_json |
| go-i18n JSON | json_go_i18n |
| Chrome i18n JSON | chrome_i18n |
| CSV with one column per language | csv |
| XLIFF 1.2 | xliff |
| Markdown | markdown |
| Plain text | txt |
| Twine | twine_txt |
| HTML | html |
Any other value returns 422 with the code project.resource_type.invalid. API V1 can’t create projects of the newer project types, such as Xcode String Catalogs or XLIFF 2; create those in the LingoHub app or with API V2. See Supported file formats.
A successful request returns 200 with the details of the new project.
Errors
| Status | Meaning |
|---|---|
401 |
The API key is missing or invalid. |
403 |
The key lacks the permission the operation needs. |
404 |
The workspace or the project doesn’t exist. |
422 |
The body of Create a project is invalid, or the branch doesn’t exist. |
Operations
| Operation | Request |
|---|---|
| Create a project | POST /v1/{workspaceUrl}/projects |
| Get project details | GET /v1/{workspaceUrl}/projects/{projectUrl} |
| Get project resource file status | GET /v1/{workspaceUrl}/projects/{projectUrl}/status |
| Get translation status of all accessible workspace projects | GET /v1/{workspaceUrl}/projects/status |
| List all projects | GET /v1/projects |