REST API for Update Main Translation Memory Batch Task

Hello,

Our firm uses GS 2020 SR1 CU08 with Trados Studio 2022 17.0.6.14902, and I am trying to automate the finalisation process via Groupshare REST APIs.

So far I've found an API called "ProjectFinalize" and it works perfectly except that it converts the bilingual file into the native source file extension (e.g. Word document). I am seeking an API, or any workaround, just to have the Server-based TMs updated without finalising the file. Please find the screenshots below for illustration:

(Note: I am aware that the API interacts directly with GS instead of Studio, but I've attached the task sequences for purpose of demonstrating our goal, and that is, to just have the main TMs updated without generating any native files)

Screenshot of the ProjectFinalize API documentation showing the POST request format and example with placeholder HOST and projectId, and a sample authorization token.

Screenshot of the Batch Tasks interface in a software application with the 'Finalize' task sequence selected, detailing the tasks 'Update Main Translation Memories' and 'Generate Target Translations'.

Screenshot of the Batch Tasks interface with the 'Update Main Translation Memories' task sequence selected, describing the task to update the main translation memories with translated bilingual files.



Generated Image Alt-Text
[edited by: RWS Community AI at 4:06 AM (GMT 0) on 15 Nov 2024]
emoji
Parents
  • Hi ,

    Sadly, GroupShare does not have the batch tasks exposed at that level of granularity via the Rest API. 

    If you don't want to have the file finalized, but still update the translation memory you could use the file download Rest API call (HTTP GET /api/projectserver/v2/projects/{projectId}/download/{type}). 
    You need to pass in the query string the following parameters: 

    • languageFileIds
    • nativeFiles=true (this must be set to true so that "updateTms" parameter is taken into account)
    • updateTms


    The boolean parameter called "updateTms" will trigger the updating of server-based TMs. Calling the download endpoint will return you an archive with the native file - but the file will not be finalized.

    This might be your best option to achieve what you're after. 

    Cheers,
    Zoltan

    emoji
  • Thank you Zoltan!

    I've checked the API documentation and apparently the queries you've mentioned refer to an HTTP call without "{type}". Nonetheless, I've tried both as per the documentation, and unfortunately none of them works. The one proposed above with the correct endpoint (without {type}) gives a 500. As for the endpoint with {type}. It gives a 200; however, I've checked the server-TM, and there's no updates.

    emoji
  • The same HTTP calls are used by the GroupShare web application when you're downloading the target version of selected files. 

    It should be a HTTP GET to api/projectserver/v2/projects/{projectId}/download?languageFileIds={languageFileId}&nativeFiles=true&updateTms=true

    Could you check once again and if you don't succeed post the HTTP request, please. 

    emoji
  • Unfortunately, it's still the same

    Screenshot of Trados Studio API parameters with checkboxes for languageFields, nativeFiles, and updateTms. Error message displayed in JSON format reads 'An error has occurred.'

    emoji


    Generated Image Alt-Text
    [edited by: Trados AI at 4:10 AM (GMT 0) on 5 Mar 2024]
  • Hmm, that should work. Can you check ApplicationService.log file for the error details? From your screenshot I can't see the HTTP error code. 

    But, from the look of it the request seems to be composed fine. That is the same request that is used by the GroupShare Web UI, you could inspect that when using the "Download target file -> Include TM Update" option - on the project details page. 

    See a screenshot, using Postman: 

    Screenshot of a Postman GET request to a Trados Studio API endpoint with query parameters for languageFiles, nativeFiles, and updateTms set to true. The response body shows garbled text, indicating a possible encoding issue. The status code is 200 OK.

    emoji


    Generated Image Alt-Text
    [edited by: Trados AI at 4:11 AM (GMT 0) on 5 Mar 2024]
  • I've tried doing the task from Groupshare, the file is downloaded; however, I couldn't see any update tasks in the background tasks.

    I've gone through the log viewer on the Web UI and found these errors

    Error message in Trados Studio TM Service Agent showing failed message processing with a routing key and multiple GUIDs listed.

    Error message in Trados Studio TM Service Agent indicating an internal service exception and resource access check failure with a task ID and stack trace information.

    emoji


    Generated Image Alt-Text
    [edited by: Trados AI at 4:11 AM (GMT 0) on 5 Mar 2024]
  •  

    You might be calling REST API GET with lanaguagefileid of source file, basically one need to pass languagefileid of the translatable/target file. See below

     

    Trados Studio screenshot showing the GS Batch Task API Test interface with a focus on the Properties panel and the Translation Files list, which includes 'Test_file_en-gb.sdlxliff' and 'Osama (Germany)'.

    Please confirm, if this helps

    emoji


    Generated Image Alt-Text
    [edited by: Trados AI at 4:11 AM (GMT 0) on 5 Mar 2024]
Reply Children