Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

To update the taskname the TASKID is needed again, also the entityVersion of the task. The entityVersion is contained in the previously fetched task entity. It is needed to prevent that two different users change an entity at the same time.

The entityVersion is not needed for all entities, only if specified in the API.

Code Block
languagebash
titleCurl Example
curl 'https://www.translate5.net/editor/task/TASKID' -X PUT -H 'Cookie: zfExtended=HERE_WILL_BE_YOUR_SESSION_ID_THEN' \ 
     -H 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8' -H 'Accept: application/json' \
     --data-urlencode 'data={"taskName":"New Task Name","entityVersion":123}'

...

On success this results in a JSON containing the importing task.

Delete Task (DELETE example)

We DELETE the task again just to demonstrate a DELETE request.

More information about the task API.

To delete the task the TASKID is needed. Also the entityVersion of the task is needed. The entityVersion is contained in the previously fetched task entity. It is needed to prevent that a user deletes an entity, which was modified on the server side in the mean time. In a DELETE request the entityVersion must be given as a HTML header field "Mqi-Entity-Version".

The entityVersion is not needed for all entities, only if specified in the API.

Code Block
languagebash
titleCurl Example
curl 'https://www.translate5.net/editor/task/TASKID' -X DELETE -H 'Cookie: zfExtended=HERE_WILL_BE_YOUR_SESSION_ID_THEN' \ 
    -H 'Accept: application/json' -H 'Mqi-Entity-Version: 123'

On success this results in a JSON containing the deleted task.