Provides access to the tasks stored in translate5.
URL: | /editor/task/[ID] |
Available Methods: | GET / POST / PUT / DELETE |
Specialities: | Since on a POST request the import data is given, the POST must be transmitted as “multipart/form-data”. POST creates the Task, and start the import process. Unless autoStartImport is set to 0, then the task is uploaded but the import starts on calling or a separate URL is called. See below. By setting the userState to the value “edit” the task is registered as to be edited by the current user. Setting it back to the userState “open” means that the the task is open again for all users. forced DELETE: if the ACL right "taskForceDelete" (resource "backend") is set to a role, users of that role can use the "force" switch to delete tasks locked by other users. |
Special Task Import URLs
URL to start the import of the uploaded task: | /editor/task/[ID]/import → [ID] is the id of the task, the taskGuid is currently not supported |
Reimport a before exported task from an excel file: | editor/task/[ID]/excelreimport |
Special Task Export URLs
URL to get the edited task data in a ZIP container: | /editor/task/export/id/[ID] |
As above, but with diff tags: | /editor/task/export/id/[ID]/diff/1 |
Export the translated file only from the ZIP container: | /editor/task/export/id/[ID]?format=filetranslation |
MQM Statistic Export: | /editor/qmstatistics/index/taskGuid/[GUID]?type=[TYPE] |
Export Task as Excel: | /editor/task/[ID]/excelexport/ |
Where [ID] is the value of the mysql-id field, [GUID] the mysql-taskGuid and [TYPE] a valid field type of the task (field type refers to the column the MQM has been used on in the editor).
Other Special Task URLs
URL to trigger specific workflow actions to that task via API. | POST /editor/task/[ID]/workflow → [ID] is the id of the task, the taskGuid is currently not supported Parameter: "trigger" which contains a string, for example: "notifyAllUsersAboutTaskAssociation" The workflow action must be configured in the LEK_workflow_action table. See also Workflow Actions and examples. |
Task Resource Layout
Name | Type | Info |
id | int | GET only |
taskGuid | string | GET only |
entityVersion | integer | GET only, set by server |
taskNr | string | |
foreignId | string | optional, is a 120 character long freetext field, not shown in the GUI. Can be used in installations where translate5 is used embedded only, to track the taskId of the management system for example. |
taskName | string | |
foreignName | string | optional, is a 255 character long, see foreignId. |
sourceLang | string/integer | POST accepts: integers (internal ID), rfc5646 string values, LCIDs (must be prefixed with "lcid-" for example lcid-1031 ), GET returns always the internally used language Id |
targetLang | string/integer | POST accepts: integers (internal ID), rfc5646 string values, LCIDs (must be prefixed with "lcid-" for example lcid-1031 ), GET returns always the internally used language Id |
relaisLang | string/integer | POST accepts: integers (internal ID), rfc5646 string values, LCIDs (must be prefixed with "lcid-" for example lcid-1031 ), GET returns always the internally used language Id |
locked | date | GET only |
lockingUser | string | GET only |
lockingUsername | string | GET only |
lockedInternalSessionUniqId | string | GET only |
state | string | POST: can be omitted, is set automatically to "import" GET: returns the current state of the task |
workflow | string | The name of the workflow used in the task |
workflowStep | integer | The workflow step nr |
workflowStepName | string | The name of the current workflow step |
pmGuid | string | |
pmName | string | |
wordCount | integer | |
| date | The date field is deprecated. Use LEK_taskUserAssoc deadlineDate instead. |
referenceFiles | boolean | GET only |
terminologie | boolean | GET only |
orderdate | date | |
edit100PercentMatch | boolean | POST only |
lockLocked | boolean | POST only |
customerId | integer | The client for the task (= id from table LEK_customer) |
enableSourceEditing | boolean | POST only |
autoStartImport | boolean | POST only, optional, defaults to true. set it to false to prevent an automatic start of the import - for additional configuration, preprocessing before the real import. |
qmSubEnabled | boolean | GET only |
qmSubFlags | auto | GET only |
qmSubSeverities | auto | GET only |
userState | string | As defined by the workflow. |
userRole | string | GET only |
userStep | string | GET only |
segmentFields | auto | GET only, list with associated segment fields |
userPrefs | auto | GET only, list with associated default user preferences |
users | auto | GET only, list with associated users |
taskassocs | auto | With Language Resources: GET only, list with associated Language Resources |
userCount | integer | GET only |
fileCount | integer | GET only |
exportRunning | string | GET only |
defaultSegmentLayout | boolean | GET only |
importUpload | HTTP Upload | POST only |
usageMode | string | Currently 'competitive' or 'cooperative' or 'simultaneous'. competitive: only the first user accepting the task may work on it. |
segmentFinishCount | integer | GET only, calculated(reviewed/translated depends on the workflow step) number of segments in the current workflow |
segmentCount | integer | GET only, total number of segments in the current task |
workflowProgressSummary | string | GET only; Workflow step progress for each workflow step. Response layout: [ {workflowStep: translation, status: finished, progress: 100}, {workflowStep: proofreading, status: running, progress: 33}, {workflowStep: translatorCheck, status: open, progress: 0} ] |
visualReview | file | POST only, Plugin Visual Review only. Adds a (single) file as the source for the visual review. If the import zip already contains a "visualReview" folder with review sources this file will be added to the ones provided in the zip. Filetype can be "pdf" or "html" |
visualReviewHtml | string | POST only, Plugin Visual Review only. An URL to a website that will be taken as a source for the visual review.The URL will be downloaded with all linked ressources. Overwrites any sources provided via "visualReview" or in the import package. The provided URL has to be fully qualified like "https://www.translate5.net/en/translate5-open-source-translation-system/" and has to be accessible without login etc. |
segmentMapping | string | POST only, Plugin Visual Review only. Defines, if the visual review is mapped to the source or target of the segments. Defaults to "source". ( source | target ) |
4 Comments
shenghao chen
Could you give an example for getting translated files in zip (export package) using API? I've tried to call /editor/task/export/id/[ID]/ but failed to get the package.
Thank you
Thomas Lauria
Hi Shenghao, I added an example on the page Basic Usage Examples. I hope that helps! Try it without the trailing "/" in the URL.
Stef Velzel
For a project I am working on, I am programatically uploading tasks to a Translate5 server. Afer this, I am trying to programmatically poll each known task and determine whether the task is done, i.e. whether translation data is complete and ready to be exported and used elsewhere. I do this to automate the translation process within a CMS. However I am unsure how to do this. So far I have found 3 options within the task resource layout:
My hunch is that I should simply use the `state` field. This because then the end user of the Translate5 server manually has to close a task for it to be 'completed'. Is this correct?
Thomas Lauria
Hi Stef,
this depends on your use case. To check for the status "end" would be ok, if your PMs (and only PMs may set tasks to end by default) end the task after the work is done.
But since you talk to the API, I assume it is no option to wait until a PM has set the task to "end".
I think the field "workflowStepName" is the one you are looking for, since it should contain the value "workflowEnded" if the last users has finished their work.
So in a workflow with translators only, the workflowStepName should switch to "workflowEnded" if they finish the task, and the same if you have added translated and reviewers. Here the workflow is ended if the reviewers have finished their work.