Slow Response Time on Update Segments API

We have started to use the API for pulling a very specific WS projects from a specific application. We also have a use case to allow our translation author to auto copy the source translation for missing translation memory for all segments and mark the task complete. There number of segments could be 40 or 50 but only a small amount like 15 might need to be updated.

The WorldSever APIs are of a great help to search for project, narrowing down to tasks. We have options to update segments and markComplete task too. We would need advice on one part where the updateSegments seems slow. It takes over 40 seconds for updating 5 segments and the api[0] even times out if we try to update more.

Is this known or is there alternate option that can be used to source copy to target and mark complete.

[0] <protocol>://<ws-host>:<ws-port>/ws-api/v2/segments?token=<sessionId>&taskId=<taskId>

  • Dear WS user,

    I am sorry to hear you have issues with update segments API.
    I tried updating a few tasks in one of our test environment: 30 segments took about 5 seconds, 45 segments took about 8 seconds.
    While the response time is not ideal, I was not able to end up in a timeout.

    You can try reducing the number of fields you are sending in the request body, as you only need to update the target content and see if the performance improves:
    [
    {
    "tag": "349033_0000000001",
    "target": "test api"

    },
    {
    "tag": "349033_0000000002",
    "target": "test api"
    },
    {
    "tag": "349033_0000000003",
    "target": "test api"
    },
    ......
    }

    You shound also send in the request only TEXT segments (I assume this is already done).


    Another way this can be achieved is with an automatic action that can be added as part of the workflow (after segment asset for example).
    There is already a sample automatic action called "Pseudotranslate: Copy Segments" which does the exact same thing: copy source to target.

    I hope the provided information help you with your customization.

    Thank you,

    Anca