How to set the reviewed status of a translation using the API

  1. The first step is to obtain the source string hash and translations for all strings in a resource. In order to do that, you can use the following API call:

$ curl -i -L --user api: -X GET https://www.transifex.com/api/2/project/project_slug/resource/resource_slug/translation/lang_code/strings/?details

where project_slug and resource_slug can be found in your project’s URL

e.g.

and lang_code corresponds to the project’s target language.

For more detailed information, please check our documentation page here: Transifex Help Center

This call returns all the source strings along with strings’ metadata including review status, e.g

  1. Scroll through the results obtained above and set the reviewed state to true using the call below:

Example:

curl -i -L --user api:(token) -X PUT -H “Content-Type: application/json” --data ‘[{“source_entity_hash”: “13dc1e0c14e4c0b322c2a185cf2def61”, “translation”:“put your existing translation from the previous step here”,“reviewed”: true},{“source_entity_hash”: “2e354e0c14e4c0b322c2a185cf2def61”, “translation”:“put your existing translation from the previous step here”,“reviewed”: true}]’ https://www.transifex.com/api/2/project/documentation/resource/api_doc/translation/fr/strings/

Note:

  • You need to pass the string hash and existing translation as a parameter. These are required by the function call.
  • The user associated with the review will be the API token user.
1 Like